public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Jike Song <albcamus@gmail.com>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 19/28] driver core: fix memory leak on one error path in bus_register()
Date: Thu,  5 Aug 2010 15:24:09 -0700	[thread overview]
Message-ID: <1281047058-23716-19-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100805213314.GB13744@kroah.com>

From: Jike Song <albcamus@gmail.com>

Reported-by: huangweibing@gmail.com
Signed-off-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 12eec3f..eb1b7fa 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -945,8 +945,8 @@ bus_devices_fail:
 	bus_remove_file(bus, &bus_attr_uevent);
 bus_uevent_fail:
 	kset_unregister(&bus->p->subsys);
-	kfree(bus->p);
 out:
+	kfree(bus->p);
 	bus->p = NULL;
 	return retval;
 }
-- 
1.7.2


  parent reply	other threads:[~2010-08-05 22:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 21:33 [GIT PATCH] driver core patches for .36 Greg KH
2010-08-05 22:23 ` [PATCH 01/28] uio: Remove IRQF_DISABLED flag from uio_pdrv_genirq.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 02/28] uio: Remove IRQF_DISABLED from uio_sercos3.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 03/28] uio: Remove IRQF_DISABLED flag from uio_cif.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 04/28] hotplug: Support kernel/hotplug sysctl variable when !CONFIG_NET Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 05/28] Driver core: internal struct dma_coherent_mem, change type of a member Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 06/28] Driver core: Drop __must_check from bus_for_each_drv() Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 07/28] firmware loader: use statically initialized data attribute Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 08/28] firmware loader: embed device into firmware_priv structure Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 09/28] Driver core: use kmemdup in platform_device_add_resources Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 10/28] Driver core: reduce duplicated code for platform_device creation Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 11/28] Driver core: move platform device creation helpers to .init.text (if MODULE=n) Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 12/28] firmware: Update hotplug script Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 13/28] sysfs: sysfs_chmod_file's attr can be const Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 14/28] dmi-id: fix a memory leak in dmi_id_init error path Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 15/28] dcdbas: remove a redundant smi_data_buf_free in dcdbas_exit Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 16/28] sysfs: fix discrepancies between implementation and documentation Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 17/28] sysfs: Fix one more signature discrepancy between sysfs implementation and docs Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 18/28] debugfs: no longer needs to depend on SYSFS Greg Kroah-Hartman
2010-08-05 22:24 ` Greg Kroah-Hartman [this message]
2010-08-05 22:24 ` [PATCH 20/28] Driver core: Add BUS_NOTIFY_BIND_DRIVER Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 21/28] cgroupfs: create /sys/fs/cgroup to mount cgroupfs on Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 22/28] scsi: Remove owner field from attribute initialization in LPFC driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 23/28] scsi: Remove owner field from attribute initialization in ARCMSR driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 24/28] leds: Remove owner field from attribute initialization in bd2802 driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 25/28] regulator: Remove owner field from attribute initialization in regulator core driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 26/28] powerpc/pci: Remove owner field from attribute initialization in PCI bridge init Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 27/28] sysfs: Remove owner field from sysfs struct attribute Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 28/28] driver core: device_rename's new_name can be const Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281047058-23716-19-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=albcamus@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox