All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: bestcomm: set bcom_eng to NULL on probe failure
@ 2026-08-17  1:54 Rosen Penev
  2026-08-17  2:07 ` sashiko-bot
  2026-08-17 13:55 ` Frank Li
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-08-17  1:54 UTC (permalink / raw)
  To: dmaengine; +Cc: Vinod Koul, Frank Li, Paul Mackerras, Grant Likely, open list

Functions like bcom_task_alloc() use if (!bcom_eng) as a safety readiness
check. If the probe fails and hits this error path, subsequent or concurrent
API calls will bypass the check and dereference the freed memory.

Fixes: 9560aea4e9d1 ("[POWERPC] mpc5200: Fix null dereference if bestcomm fails to initialize")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/dma/bestcomm/bestcomm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c
index 432b43520ddc..ec58d2c6573f 100644
--- a/drivers/dma/bestcomm/bestcomm.c
+++ b/drivers/dma/bestcomm/bestcomm.c
@@ -445,6 +445,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
 	release_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma));
 error_sramclean:
 	kfree(bcom_eng);
+	bcom_eng = NULL;
 	bcom_sram_cleanup();
 error_ofput:
 	of_node_put(op->dev.of_node);
-- 
2.55.0


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

end of thread, other threads:[~2026-08-17 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17  1:54 [PATCH] dmaengine: bestcomm: set bcom_eng to NULL on probe failure Rosen Penev
2026-08-17  2:07 ` sashiko-bot
2026-08-17 13:55 ` Frank Li

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.