Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220308064952.15743-1-linmq006@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Miaoqian Lin and committed by
Vinod Koul
7104b9cb 206680c4

+2 -2
+2 -2
drivers/dma/imx-sdma.c
··· 1885 1885 u32 reg, val, shift, num_map, i; 1886 1886 int ret = 0; 1887 1887 1888 - if (IS_ERR(np) || IS_ERR(gpr_np)) 1888 + if (IS_ERR(np) || !gpr_np) 1889 1889 goto out; 1890 1890 1891 1891 event_remap = of_find_property(np, propname, NULL); ··· 1933 1933 } 1934 1934 1935 1935 out: 1936 - if (!IS_ERR(gpr_np)) 1936 + if (gpr_np) 1937 1937 of_node_put(gpr_np); 1938 1938 1939 1939 return ret;