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: <20200419091923.5728-1-tangbin@cmss.chinamobile.com>
Date:   Sun, 19 Apr 2020 17:19:23 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     lee.jones@...aro.org
Cc:     linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>,
        Shengju Zhang <zhangshengju@...s.chinamobile.com>
Subject: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()

In the function asic3_mfd_probe(), when get resource or irq
failed, the value returned just detected and debug error message,
but there were no error checking return. So add the right error
checking return. And remove the redundant 'ret = 0'.

Signed-off-by: Shengju Zhang <zhangshengju@...s.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 drivers/mfd/asic3.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 7694de3f1..827449b7a 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -881,12 +881,18 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 	int irq, ret;
 
 	mem_sdio = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (!mem_sdio)
+	if (!mem_sdio) {
 		dev_dbg(asic->dev, "no SDIO MEM resource\n");
+		ret = -EINVAL;
+		goto out;
+	}
 
 	irq = platform_get_irq(pdev, 1);
-	if (irq < 0)
+	if (irq < 0) {
 		dev_dbg(asic->dev, "no SDIO IRQ resource\n");
+		ret = irq;
+		goto out;
+	}
 
 	/* DS1WM */
 	asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT),
@@ -924,7 +930,6 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 			goto out;
 	}
 
-	ret = 0;
 	if (pdata->leds) {
 		int i;
 
-- 
2.20.1.windows.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ