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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730225339.13165-1-amishin@t-argos.ru>
Date: Wed, 31 Jul 2024 01:53:39 +0300
From: Aleksandr Mishin <amishin@...rgos.ru>
To: Rajmohan Mani <rajmohan.mani@...el.com>
CC: Aleksandr Mishin <amishin@...rgos.ru>, "Rafael J. Wysocki"
	<rafael@...nel.org>, Len Brown <lenb@...nel.org>, Andy Shevchenko
	<andy@...nel.org>, Mika Westerberg <mika.westerberg@...ux.intel.com>, Sakari
 Ailus <sakari.ailus@...ux.intel.com>, <linux-acpi@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>, Andy
 Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v2] ACPI / PMIC: Remove unneeded check in tps68470_pmic_opregion_probe()

In tps68470_pmic_opregion_probe() pointer 'dev' is compared to NULL which
is useless.

Fix this issue by removing unneeded check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: e13452ac3790 ("ACPI / PMIC: Add TI PMIC TPS68470 operation region driver")
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Aleksandr Mishin <amishin@...rgos.ru>
Reviewed-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
---
v1->v2:
  - Add Reviewed-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
    (https://lore.kernel.org/all/Zokw6XRZxv0YqIiZ@kekkonen.localdomain/)
  - Update log message and its level as suggested by Andy
    (https://lore.kernel.org/all/CAHp75Vefw5FB1mK8v-FJ5MBeSo_N9fgiAFPdYw2w_OCX5UxrAA@mail.gmail.com/)

 drivers/acpi/pmic/tps68470_pmic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/pmic/tps68470_pmic.c b/drivers/acpi/pmic/tps68470_pmic.c
index ebd03e472955..0d1a82eeb4b0 100644
--- a/drivers/acpi/pmic/tps68470_pmic.c
+++ b/drivers/acpi/pmic/tps68470_pmic.c
@@ -376,10 +376,8 @@ static int tps68470_pmic_opregion_probe(struct platform_device *pdev)
 	struct tps68470_pmic_opregion *opregion;
 	acpi_status status;
 
-	if (!dev || !tps68470_regmap) {
-		dev_warn(dev, "dev or regmap is NULL\n");
-		return -EINVAL;
-	}
+	if (!tps68470_regmap)
+		return dev_err_probe(dev, -EINVAL, "regmap is missing\n");
 
 	if (!handle) {
 		dev_warn(dev, "acpi handle is NULL\n");
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ