[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230318062255.76-1-void0red@gmail.com>
Date: Sat, 18 Mar 2023 14:22:54 +0800
From: void0red <void0red@...il.com>
To: vkoul@...nel.org
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
peter.ujfalusi@...il.com, void0red@...il.com
Subject: [PATCH v2 1/2] dmaengine: ti: add null check of devm_kasprintf in udma_probe
From: Kang Chen <void0red@...il.com>
devm_kasprintf may fails, uc->name might be null and wrong irq
name will be used in request.
Fixes: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA")
Acked-by: Peter Ujfalusi <peter.ujfalusi@...il.com>
Reviewed-by: Vinod Koul <vkoul@...nel.org>
Signed-off-by: Kang Chen <void0red@...il.com>
---
v2 -> v1: split into two patches and add some tags
drivers/dma/ti/k3-udma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 7e23a6fdef95..692d1d25c70a 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -5494,6 +5494,8 @@ static int udma_probe(struct platform_device *pdev)
uc->config.dir = DMA_MEM_TO_MEM;
uc->name = devm_kasprintf(dev, GFP_KERNEL, "%s chan%d",
dev_name(dev), i);
+ if (!uc->name)
+ return -ENOMEM;
vchan_init(&uc->vc, &ud->ddev);
/* Use custom vchan completion handling */
--
2.34.1
Powered by blists - more mailing lists