lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220128171403.29878-1-linmq006@gmail.com>
Date:   Fri, 28 Jan 2022 17:14:03 +0000
From:   Miaoqian Lin <linmq006@...il.com>
To:     Vinod Koul <vkoul@...nel.org>,
        Zhangfei Gao <zhangfei.gao@...vell.com>,
        Arnd Bergmann <arnd@...db.de>, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     linmq006@...il.com
Subject: [PATCH] dmaengine: mmp_pdma: Fix missing IRQ check in mmp_pdma_probe

This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_threaded_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.
Stop calling request_threaded_irq() with invalid IRQ #s.

Fixes: c8acd6aa6bed ("dmaengine: mmp-pdma support")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
 drivers/dma/mmp_pdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 5a53d7fcef01..c03f4f7ece88 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -1067,6 +1067,8 @@ static int mmp_pdma_probe(struct platform_device *op)
 	if (irq_num != dma_channels) {
 		/* all chan share one irq, demux inside */
 		irq = platform_get_irq(op, 0);
+		if (irq < 0)
+			return irq;
 		ret = devm_request_irq(pdev->dev, irq, mmp_pdma_int_handler,
 				       IRQF_SHARED, "pdma", pdev);
 		if (ret)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ