[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1326506763-9821-1-git-send-email-jhbird.choi@samsung.com>
Date: Sat, 14 Jan 2012 11:06:03 +0900
From: jhbird.choi@...sung.com
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Jonghwan Choi <jhbird.choi@...sung.com>
Subject: [PATCH] driver-core: Fix null reference in subsys_interface_unregister
From: Jonghwan Choi <jhbird.choi@...sung.com>
Check if the sif is not NULL before de-referencing it
Signed-off-by: Jonghwan Choi <jhbird.choi@...sung.com>
---
drivers/base/bus.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 99dc592..4ddb38b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -1193,13 +1193,15 @@ EXPORT_SYMBOL_GPL(subsys_interface_register);
void subsys_interface_unregister(struct subsys_interface *sif)
{
- struct bus_type *subsys = sif->subsys;
+ struct bus_type *subsys;
struct subsys_dev_iter iter;
struct device *dev;
- if (!sif)
+ if (!sif || !sif->subsys)
return;
+ subsys = sif->subsys;
+
mutex_lock(&subsys->p->mutex);
list_del_init(&sif->node);
if (sif->remove_dev) {
--
1.7.1
--
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