Patch "driver core: bus: Goto appropriate labels on failure in bus_add_device" has been added to the 4.0-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
driver core: bus: Goto appropriate labels on failure in bus_add_device
to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch
and it can be found in the queue-4.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
1c34203a1496d1849ba978021b878b3447d433c8Mon Sep 17 00:00:00 2001
From: Junjie Mao <[email protected]>
Date: Wed, 28 Jan 2015 10:02:44 +0800
Subject: driver core: bus: Goto appropriate labels on failure in bus_add_device
From: Junjie Mao <[email protected]>
commit 1c34203a1496d1849ba978021b878b3447d433c8 upstream.
It is not necessary to call device_remove_groups() when device_add_groups() fails.
The group added by device_add_groups() should be removed if sysfs_create_link() fails.
--- drivers/base/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/bus.c +2 -2
@@ -515,11 +515,11 @@ int bus_add_device(struct device *dev) goto out_put; error =device_add_groups (dev, bus->dev_groups);if (error) - goto out_groups; + goto out_id; error =sysfs_create_link (&bus->p->devices_kset->kobj, &dev->kobj,dev_name (dev));if (error) - goto out_id; + goto out_groups; error =sysfs_create_link (&dev->kobj, &dev->bus->p->subsys.kobj,"subsystem" );if (error)
Patches currently in stable-queue which might be from [email protected] are
queue-4.0/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch