Skip to contentSkip to conversation

driver core: fix possible memory leak in bus_register()

PATCH New Jike Song 1 participant 1 message Jul 15, 2010 Driver core

lore
Share & tools
lore

Jike Song

author
#0 lore raw

PATCH 1/1 driver core: fix possible memory leak in bus_register()

---
 drivers/base/bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/bus.c +1 -1
index 12eec3f..eb1b7fa 100644
@@ -945,8 +945,8 @@ bus_devices_fail:
 	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;
 }
Signature · 1 line
1.6.4.GIT