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>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  1 Jun 2023 16:51:32 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     albeu@...e.fr, linus.walleij@...aro.org, brgl@...ev.pl
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] gpio: ath79: Add missing check for platform_get_irq

Add the missing check for platform_get_irq and return error
if it fails.

Fixes: 2b8f89e19b6d ("gpio: ath79: Add support for the interrupt controller")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 drivers/gpio/gpio-ath79.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index aa0a954b8392..4b67428a8c17 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -286,6 +286,8 @@ static int ath79_gpio_probe(struct platform_device *pdev)
 		if (!girq->parents)
 			return -ENOMEM;
 		girq->parents[0] = platform_get_irq(pdev, 0);
+		if (girq->parents[0] < 0)
+			return -ENODEV;
 		girq->default_type = IRQ_TYPE_NONE;
 		girq->handler = handle_simple_irq;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ