From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:44016 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbbEBSZJ (ORCPT ); Sat, 2 May 2015 14:25:09 -0400 Subject: Patch "driver core: bus: Goto appropriate labels on failure in bus_add_device" has been added to the 3.19-stable tree To: junjie_mao@yeah.net, gregkh@linuxfoundation.org Cc: , From: Date: Sat, 02 May 2015 20:25:04 +0200 Message-ID: <1430591104223215@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 3.19-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-3.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 1c34203a1496d1849ba978021b878b3447d433c8 Mon Sep 17 00:00:00 2001 From: Junjie Mao 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 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 Signed-off-by: Greg Kroah-Hartman --- 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-3.19/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch