All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: imx-sdma: Fix error checking in sdma_event_remap
@ 2022-03-08  6:49 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-03-08  6:49 UTC (permalink / raw)
  To: Vinod Koul, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Zidan Wang, dmaengine,
	linux-arm-kernel, linux-kernel
  Cc: linmq006

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(-)

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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] dmaengine: imx-sdma: Fix error checking in sdma_event_remap
@ 2022-03-08  6:49 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-03-08  6:49 UTC (permalink / raw)
  To: Vinod Koul, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Zidan Wang, dmaengine,
	linux-arm-kernel, linux-kernel
  Cc: linmq006

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(-)

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;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dmaengine: imx-sdma: Fix error checking in sdma_event_remap
  2022-03-08  6:49 ` Miaoqian Lin
@ 2022-04-11 14:18   ` Vinod Koul
  -1 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2022-04-11 14:18 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Zidan Wang, dmaengine, linux-arm-kernel,
	linux-kernel

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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dmaengine: imx-sdma: Fix error checking in sdma_event_remap
@ 2022-04-11 14:18   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2022-04-11 14:18 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Zidan Wang, dmaengine, linux-arm-kernel,
	linux-kernel

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

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-11 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08  6:49 [PATCH] dmaengine: imx-sdma: Fix error checking in sdma_event_remap Miaoqian Lin
2022-03-08  6:49 ` Miaoqian Lin
2022-04-11 14:18 ` Vinod Koul
2022-04-11 14:18   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.