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:   Tue, 11 Feb 2020 16:20:59 +0000
From:   Colin King <colin.king@...onical.com>
To:     Nuno Sá <nuno.sa@...log.com>,
        Jean Delvare <jdelvare@...e.com>,
        Guenter Roeck <linux@...ck-us.net>, linux-hwmon@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] hwmon: axi-fan-control: fix uninitialized dereference of pointer res

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

Currently the resource pointer ret is uninitialized and it is
being dereferenced when printing out a debug message. Fix this
by fetching the resource and assigning pointer res.  It is
a moot point that we sanity check for a null res since a successful
call to devm_platform_ioremap_resource has already occurred so
in theory it should never be non-null.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: 690dd9ce04f6 ("hwmon: Support ADI Fan Control IP")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/hwmon/axi-fan-control.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c
index 8041ba7cc152..36e0d060510a 100644
--- a/drivers/hwmon/axi-fan-control.c
+++ b/drivers/hwmon/axi-fan-control.c
@@ -415,6 +415,9 @@ static int axi_fan_control_probe(struct platform_device *pdev)
 	if (!ctl->clk_rate)
 		return -EINVAL;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
 	dev_dbg(&pdev->dev, "Re-mapped from 0x%08llX to %p\n",
 		(unsigned long long)res->start, ctl->base);
 
-- 
2.25.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ