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]
Message-Id: <20210819121137.11928-1-tangbin@cmss.chinamobile.com>
Date:   Thu, 19 Aug 2021 20:11:37 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     sre@...nel.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>,
        Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: [PATCH] power: supply: cpcap-battery: remove redundant check

In the function cpcap_battery_probe(), the check of '!match->data'
can actually never happen for the driver. First, this probe function
will only be called if there is a match with an entry from the OF
device ID table, and then all entries have .data set to a valid point.
So remove the redundant check.

Co-developed-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 drivers/power/supply/cpcap-battery.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 8d62d4241..a3866826b 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -1035,12 +1035,6 @@ static int cpcap_battery_probe(struct platform_device *pdev)
 	if (!match)
 		return -EINVAL;
 
-	if (!match->data) {
-		dev_err(&pdev->dev, "no configuration data found\n");
-
-		return -ENODEV;
-	}
-
 	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
 	if (!ddata)
 		return -ENOMEM;
-- 
2.20.1.windows.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ