projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6309e7
)
driver core: Prevent reference to freed memory on error path
author
Phil Carmody
<ext-phil.2.carmody@nokia.com>
Mon, 14 Dec 2009 18:28:12 +0000
(20:28 +0200)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Wed, 23 Dec 2009 19:23:44 +0000
(11:23 -0800)
priv is drv->p. So only free drv->p after we've finished using priv.
Found using a static code analysis tool
Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/bus.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/base/bus.c
b/drivers/base/bus.c
index 63c143e54a5783656d9f0208acd3c9c4166ec4e2..c0c5a43d9fb3e6cadbd962b7272766be472741a6 100644
(file)
--- a/
drivers/base/bus.c
+++ b/
drivers/base/bus.c
@@
-703,9
+703,9
@@
int bus_add_driver(struct device_driver *drv)
return 0;
out_unregister:
+ kobject_put(&priv->kobj);
kfree(drv->p);
drv->p = NULL;
- kobject_put(&priv->kobj);
out_put_bus:
bus_put(bus);
return error;