]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2015 18:24:51 +0000 (20:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2015 18:24:51 +0000 (20:24 +0200)
added patches:
driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch

queue-3.14/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch b/queue-3.14/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch
new file mode 100644 (file)
index 0000000..3d330c0
--- /dev/null
@@ -0,0 +1,39 @@
+From 1c34203a1496d1849ba978021b878b3447d433c8 Mon Sep 17 00:00:00 2001
+From: Junjie Mao <junjie_mao@yeah.net>
+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 <junjie_mao@yeah.net>
+
+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.
+
+Fixes: fa6fdb33b486 ("driver core: bus_type: add dev_groups")
+Signed-off-by: Junjie Mao <junjie_mao@yeah.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/bus.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/base/bus.c
++++ b/drivers/base/bus.c
+@@ -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)
index f3252968a9f352ee42934c4f01620f2437d27a99..19fd2e81b7ee649d3e336946182d4333c4ce404f 100644 (file)
@@ -88,3 +88,4 @@ wl18xx-show-rx_frames_per_rates-as-an-array-as-it-really-is.patch
 crypto-omap-aes-fix-support-for-unequal-lengths.patch
 c6x-time-ensure-consistency-in-__init.patch
 memstick-mspro_block-add-missing-curly-braces.patch
+driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch