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:
committed by
Greg Kroah-Hartman
parent
c462e8cd57
commit
600c20f34f
@ -945,8 +945,8 @@ bus_devices_fail:
|
|||||||
bus_remove_file(bus, &bus_attr_uevent);
|
bus_remove_file(bus, &bus_attr_uevent);
|
||||||
bus_uevent_fail:
|
bus_uevent_fail:
|
||||||
kset_unregister(&bus->p->subsys);
|
kset_unregister(&bus->p->subsys);
|
||||||
kfree(bus->p);
|
|
||||||
out:
|
out:
|
||||||
|
kfree(bus->p);
|
||||||
bus->p = NULL;
|
bus->p = NULL;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user