From 600c20f34f645adf7884277302b10601583aa7d5 Mon Sep 17 00:00:00 2001 From: Jike Song Date: Thu, 15 Jul 2010 17:43:54 +0800 Subject: [PATCH] driver core: fix memory leak on one error path in bus_register() Reported-by: huangweibing@gmail.com Signed-off-by: Jike Song Signed-off-by: Greg Kroah-Hartman --- drivers/base/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 12eec3f633b..eb1b7fa20dc 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -945,8 +945,8 @@ bus_devices_fail: bus_remove_file(bus, &bus_attr_uevent); bus_uevent_fail: kset_unregister(&bus->p->subsys); - kfree(bus->p); out: + kfree(bus->p); bus->p = NULL; return retval; } -- 2.20.1