dmaengine: imx-sdma: Fix error checking in sdma_event_remap
Subsystems (2)
PATCH 1/1 dmaengine: imx-sdma: Fix error checking in sdma_event_remap
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 <[email protected]>
--- drivers/dma/imx-sdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/imx-sdma.c +2 -2
@@ -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;
Signature · 1 line
2.17.1
Quoted 2 lines · Miaoqian Lin
of_parse_phandle()returns NULL on errors, rather than error pointers. Using NULL check ongrp_npto fix this.
Applied, thanks
Signature · 1 line
~Vinod