stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "driver core: bus: Goto appropriate labels on failure in bus_add_device" has been added to the 4.0-stable tree
@ 2015-05-02 18:25 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-05-02 18:25 UTC (permalink / raw)
  To: junjie_mao, gregkh; +Cc: stable, stable-commits


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 <stable@vger.kernel.org> know about it.


>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)


Patches currently in stable-queue which might be from junjie_mao@yeah.net are

queue-4.0/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-02 18:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-02 18:25 Patch "driver core: bus: Goto appropriate labels on failure in bus_add_device" has been added to the 4.0-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).