[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230318062255.76-2-void0red@gmail.com>
Date: Sat, 18 Mar 2023 14:22:55 +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 2/2] dmaengine: ti: add null check of devm_kasprintf in edma_probe
From: Kang Chen <void0red@...il.com>
devm_kasprintf may fails, irq_name might be null and wrong irq
name will be used in request.
Fixes: 2b6b3b742019 ("ARM/dmaengine: edma: Merge the two drivers under drivers/dma/")
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/edma.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index fa06d7e6d8e3..85cd72b6401a 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2413,6 +2413,10 @@ static int edma_probe(struct platform_device *pdev)
if (irq >= 0) {
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint",
dev_name(dev));
+ if (!irq_name) {
+ ret = -ENOMEM;
+ goto err_disable_pm;
+ }
ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name,
ecc);
if (ret) {
@@ -2429,6 +2433,10 @@ static int edma_probe(struct platform_device *pdev)
if (irq >= 0) {
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint",
dev_name(dev));
+ if (!irq_name) {
+ ret = -ENOMEM;
+ goto err_disable_pm;
+ }
ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name,
ecc);
if (ret) {
--
2.34.1
Powered by blists - more mailing lists