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: <20211223121639.1330292-1-jiasheng@iscas.ac.cn>
Date:   Thu, 23 Dec 2021 20:16:39 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     andy.shevchenko@...il.com, davem@...emloft.net, kuba@...nel.org,
        yangyingliang@...wei.com, sashal@...nel.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH v4] fjes: Check for error irq

The platform_get_irq() is possible to fail.
So the return value needs to check to prevent the use of error irq
number.

Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
Changelog:

v3 -> v4

*Change 1. Using error variable to check.
*Change 2. Correct the word.
*Change 3. Add new commit message.
---
 drivers/net/fjes/fjes_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index e449d9466122..17f2fd937e4d 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1268,7 +1268,12 @@ static int fjes_probe(struct platform_device *plat_dev)
 	}
 	hw->hw_res.start = res->start;
 	hw->hw_res.size = resource_size(res);
-	hw->hw_res.irq = platform_get_irq(plat_dev, 0);
+
+	err = platform_get_irq(plat_dev, 0);
+	if (err < 0)
+		goto err_free_control_wq;
+	hw->hw_res.irq = err;
+
 	err = fjes_hw_init(&adapter->hw);
 	if (err)
 		goto err_free_control_wq;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ