diff mbox series

dmaengine: imx-sdma: Fix error checking in sdma_event_remap

Message ID 20220308064952.15743-1-linmq006@gmail.com (mailing list archive)
State New, archived
Headers show
Series dmaengine: imx-sdma: Fix error checking in sdma_event_remap | expand

Commit Message

Miaoqian Lin March 8, 2022, 6:49 a.m. UTC
of_parse_phandle() returns NULL on errors, rather than error
pointers. Using NULL check on grp_np to fix this.

Fixes: d078cd1b4185 ("dmaengine: imx-sdma: Add imx6sx platform support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vinod Koul April 11, 2022, 2:18 p.m. UTC | #1
On 08-03-22, 06:49, Miaoqian Lin wrote:
> of_parse_phandle() returns NULL on errors, rather than error
> pointers. Using NULL check on grp_np to fix this.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 75ec0754d4ad..0be1171610af 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1869,7 +1869,7 @@  static int sdma_event_remap(struct sdma_engine *sdma)
 	u32 reg, val, shift, num_map, i;
 	int ret = 0;
 
-	if (IS_ERR(np) || IS_ERR(gpr_np))
+	if (IS_ERR(np) || !gpr_np)
 		goto out;
 
 	event_remap = of_find_property(np, propname, NULL);
@@ -1917,7 +1917,7 @@  static int sdma_event_remap(struct sdma_engine *sdma)
 	}
 
 out:
-	if (!IS_ERR(gpr_np))
+	if (gpr_np)
 		of_node_put(gpr_np);
 
 	return ret;