[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070814212248.GD18945@stusta.de>
Date: Tue, 14 Aug 2007 23:22:48 +0200
From: Adrian Bunk <bunk@...nel.org>
To: johnpol@....mipt.ru
Cc: linux-kernel@...r.kernel.org
Subject: [2.6 patch] w1_remove_master_device(): fix check-after-use
The Coverity checker spotted that we'd have already oops'ed if "dev"
was NULL.
Signed-off-by: Adrian Bunk <bunk@...nel.org>
---
--- linux-2.6.23-rc1-mm2/drivers/w1/w1_int.c.old 2007-08-08 14:38:50.000000000 +0200
+++ linux-2.6.23-rc1-mm2/drivers/w1/w1_int.c 2007-08-08 14:38:58.000000000 +0200
@@ -171,22 +171,17 @@
void w1_remove_master_device(struct w1_bus_master *bm)
{
struct w1_master *dev = NULL;
list_for_each_entry(dev, &w1_masters, w1_master_entry) {
if (!dev->initialized)
continue;
if (dev->bus_master->data == bm->data)
break;
}
- if (!dev) {
- printk(KERN_ERR "Device doesn't exist.\n");
- return;
- }
-
__w1_remove_master_device(dev);
}
EXPORT_SYMBOL(w1_add_master_device);
EXPORT_SYMBOL(w1_remove_master_device);
-
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