Skip to content

Commit

Permalink
driver core: fix memory leak on one error path in bus_register()
Browse files Browse the repository at this point in the history
Reported-by: huangweibing@gmail.com
Signed-off-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jike Song authored and Greg Kroah-Hartman committed Aug 5, 2010
1 parent c462e8c commit 600c20f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 600c20f

Please sign in to comment.