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: <20061219085144.GI4049@APFDCB5C>
Date:	Tue, 19 Dec 2006 17:51:44 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Wim Van Sebroeck <wim@...ana.be>, Ben Dooks <ben@...tec.co.uk>,
	Dimitry Andric <dimitry.andric@...tom.com>
Subject: [PATCH] watchdog: fix clk_get() error check

The return value of clk_get() should be checked by IS_ERR().

Cc: Wim Van Sebroeck <wim@...ana.be>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>

---
 drivers/char/watchdog/pnx4008_wdt.c |    3 ++-
 drivers/char/watchdog/s3c2410_wdt.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: 2.6-mm/drivers/char/watchdog/pnx4008_wdt.c
===================================================================
--- 2.6-mm.orig/drivers/char/watchdog/pnx4008_wdt.c
+++ 2.6-mm/drivers/char/watchdog/pnx4008_wdt.c
@@ -283,7 +283,8 @@ static int pnx4008_wdt_probe(struct plat
 	wdt_base = (void __iomem *)IO_ADDRESS(res->start);
 
 	wdt_clk = clk_get(&pdev->dev, "wdt_ck");
-	if (!wdt_clk) {
+	if (IS_ERR(wdt_clk)) {
+		ret = PTR_ERR(wdt_clk);
 		release_resource(wdt_mem);
 		kfree(wdt_mem);
 		goto out;
Index: 2.6-mm/drivers/char/watchdog/s3c2410_wdt.c
===================================================================
--- 2.6-mm.orig/drivers/char/watchdog/s3c2410_wdt.c
+++ 2.6-mm/drivers/char/watchdog/s3c2410_wdt.c
@@ -392,10 +392,10 @@ static int s3c2410wdt_probe(struct platf
 	}
 
 	wdt_clock = clk_get(&pdev->dev, "watchdog");
-	if (wdt_clock == NULL) {
+	if (IS_ERR(wdt_clock)) {
 		printk(KERN_INFO PFX "failed to find watchdog clock source\n");
 		iounmap(wdt_base);
-		return -ENOENT;
+		return PTR_ERR(wdt_clock);
 	}
 
 	clk_enable(wdt_clock);
-
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