[PATCH 5.17 0704/1126] net: wwan: qcom_bam_dmux: fix wrong pointer passed to IS_ERR()
From: Greg Kroah-Hartman
Date: Tue Apr 05 2022 - 05:52:02 EST
From: Yang Yingliang <yangyingliang@xxxxxxxxxx>
[ Upstream commit 6b3c74550224c3be24c4cf6ab8c333602b458bff ]
It should check dmux->tx after calling dma_request_chan().
Fixes: 21a0ffd9b38c ("net: wwan: Add Qualcomm BAM-DMUX WWAN network driver")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Reviewed-by: Stephan Gerhold <stephan@xxxxxxxxxxx>
Link: https://lore.kernel.org/r/20220319032450.3288224-1-yangyingliang@xxxxxxxxxx
Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/net/wwan/qcom_bam_dmux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wwan/qcom_bam_dmux.c b/drivers/net/wwan/qcom_bam_dmux.c
index 5dfa2eba6014..17d46f4d2913 100644
--- a/drivers/net/wwan/qcom_bam_dmux.c
+++ b/drivers/net/wwan/qcom_bam_dmux.c
@@ -755,7 +755,7 @@ static int __maybe_unused bam_dmux_runtime_resume(struct device *dev)
return 0;
dmux->tx = dma_request_chan(dev, "tx");
- if (IS_ERR(dmux->rx)) {
+ if (IS_ERR(dmux->tx)) {
dev_err(dev, "Failed to request TX DMA channel: %pe\n", dmux->tx);
dmux->tx = NULL;
bam_dmux_runtime_suspend(dev);
--
2.34.1