提交 600c20f3 编写于 作者: J Jike Song 提交者: Greg Kroah-Hartman

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

Reported-by: huangweibing@gmail.com
Signed-off-by: NJike Song <albcamus@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c462e8cd
...@@ -945,8 +945,8 @@ int bus_register(struct bus_type *bus) ...@@ -945,8 +945,8 @@ int bus_register(struct bus_type *bus)
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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册