The patch titled driver core fixes: bus_add_device() cleanup on error has been added to the -mm tree. Its filename is driver-core-fixes-bus_add_device-cleanup-on-error.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: driver core fixes: bus_add_device() cleanup on error From: Cornelia Huck <cornelia.huck@xxxxxxxxxx> Correct cleanup in the error path of bus_add_device(). Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/base/bus.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff -puN drivers/base/bus.c~driver-core-fixes-bus_add_device-cleanup-on-error drivers/base/bus.c --- a/drivers/base/bus.c~driver-core-fixes-bus_add_device-cleanup-on-error +++ a/drivers/base/bus.c @@ -372,19 +372,29 @@ int bus_add_device(struct device * dev) pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); error = device_add_attrs(bus, dev); if (error) - goto out; + goto out_put; error = sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); if (error) - goto out; + goto out_id; error = sysfs_create_link(&dev->kobj, &dev->bus->subsys.kset.kobj, "subsystem"); if (error) - goto out; + goto out_subsys; error = sysfs_create_link(&dev->kobj, &dev->bus->subsys.kset.kobj, "bus"); + if (error) + goto out_bus; } -out: + return 0; +out_bus: + sysfs_remove_link(&dev->kobj, "subsystem"); +out_subsys: + sysfs_remove_link(&bus->devices.kobj, dev->bus_id); +out_id: + device_remove_attrs(bus, dev); +out_put: + put_bus(dev->bus); return error; } _ Patches currently in -mm which might be from cornelia.huck@xxxxxxxxxx are driver-core-fixes-make_class_name-retval-check.patch driver-core-fixes-device_register-retval-check-in.patch driver-core-fixes-sysfs_create_link-retval-check-in.patch driver-core-fixes-bus_add_attrs-retval-check.patch driver-core-fixes-bus_add_device-cleanup-on-error.patch driver-core-fixes-device_add-cleanup-on-error.patch driver-core-fixes-device_create_file-retval-check-in.patch driver-core-fixes-sysfs_create_group-retval-in-topologyc.patch git-s390.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html