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:
parent
c462e8cd57
commit
600c20f34f
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue