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, 29 Dec 2016 15:23:12 +0000
From:   Colin King <colin.king@...onical.com>
To:     Sebastian Reichel <sre@...nel.org>, linux-pm@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata

From: Colin Ian King <colin.king@...onical.com>

pdata is being null checked twice, the 2nd check is redundant code
and can be removed.

Fixes CoverityScan CID 1392340 "Logically dead code"

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/power/supply/wm97xx_battery.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c
index e3edb31..bd4f666 100644
--- a/drivers/power/supply/wm97xx_battery.c
+++ b/drivers/power/supply/wm97xx_battery.c
@@ -175,11 +175,6 @@ static int wm97xx_bat_probe(struct platform_device *dev)
 	if (dev->id != -1)
 		return -EINVAL;
 
-	if (!pdata) {
-		dev_err(&dev->dev, "No platform_data supplied\n");
-		return -EINVAL;
-	}
-
 	if (gpio_is_valid(pdata->charge_gpio)) {
 		ret = gpio_request(pdata->charge_gpio, "BATT CHRG");
 		if (ret)
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ