driver core: fix memory leak on one error path in bus_register()

Reported-by: huangweibing@gmail.com
Signed-off-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jike Song 2010-07-15 17:43:54 +08:00 committed by Greg Kroah-Hartman
parent c462e8cd57
commit 600c20f34f

View file

@ -945,8 +945,8 @@ int bus_register(struct bus_type *bus)
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;
}