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]
Date:	Fri, 17 Nov 2006 15:21:59 +0100
From:	Adrian Bunk <bunk@...sta.de>
To:	Pavel Mironchik <pmironchik@...ifacio.net>
Cc:	a.zummo@...ertech.it, linux-kernel@...r.kernel.org
Subject: [2.6 patch] drivers/rtc/rtc-rs5c372.c: fix a NULL dereference

The correct order is: NULL check before dereference

This was a guaranteed NULL dereference with debugging enabled since 
rs5c372_sysfs_show_osc() does actually pass NULL...

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@...sta.de>

--- linux-2.6.19-rc5-mm2/drivers/rtc/rtc-rs5c372.c.old	2006-11-17 14:15:53.000000000 +0100
+++ linux-2.6.19-rc5-mm2/drivers/rtc/rtc-rs5c372.c	2006-11-17 14:16:53.000000000 +0100
@@ -126,13 +126,13 @@ static int rs5c372_get_trim(struct i2c_c
 		return -EIO;
 	}
 
-	dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, *trim);
-
 	if (osc)
 		*osc = (buf & RS5C372_TRIM_XSL) ? 32000 : 32768;
 
-	if (trim)
+	if (trim) {
 		*trim = buf & RS5C372_TRIM_MASK;
+		dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, *trim);
+	}
 
 	return 0;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ