Skip to contentSkip to conversation

dmaengine: st_fdma: Fix the error return code in st_fdma_probe()

PATCH New Wei Yongjun 3 participants 3 messages Oct 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: st_fdma: Fix the error return code in st_fdma_probe()

From: Wei Yongjun <[email protected]>

In case of error, the function st_slim_rproc_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

---
 drivers/dma/st_fdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/st_fdma.c +1 -1
index 515e1d4..a66a57b 100644
@@ -802,7 +802,7 @@ static int st_fdma_probe(struct platform_device *pdev)
 	}
 
 	fdev->slim_rproc = st_slim_rproc_alloc(pdev, fdev->fw_name);
-	if (!fdev->slim_rproc) {
+	if (IS_ERR(fdev->slim_rproc)) {
 		ret = PTR_ERR(fdev->slim_rproc);
 		dev_err(&pdev->dev, "slim_rproc_alloc failed (%d)\n", ret);
 		goto err;
Applied
#2 lore raw

PATCH 1/1 dmaengine: st_fdma: Fix the error return code in st_fdma_probe()

In reply to Wei Yongjun
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function st_slim_rproc_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Applied, thanks

Signature · 1 line
~Vinod