public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/7] driver core: safely unbind drivers for devices not on a bus
Date: Fri, 14 Apr 2006 13:09:56 -0700	[thread overview]
Message-ID: <11450453961549-git-send-email-greg@kroah.com> (raw)
In-Reply-To: <11450453963619-git-send-email-greg@kroah.com>

This patch (as667) changes the __device_release_driver() routine to
prevent it from crashing when it runs across a device not on any bus.
This seems logical, inasmuch as the corresponding bus_add_device()
routine has an explicit check allowing it to accept such devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---

 drivers/base/dd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

0f836ca4c122f4ef096110d652a6326fe34e6961
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 730a9ce..889c711 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -209,7 +209,7 @@ static void __device_release_driver(stru
 		sysfs_remove_link(&dev->kobj, "driver");
 		klist_remove(&dev->knode_driver);
 
-		if (dev->bus->remove)
+		if (dev->bus && dev->bus->remove)
 			dev->bus->remove(dev);
 		else if (drv->remove)
 			drv->remove(dev);
-- 
1.2.6



  reply	other threads:[~2006-04-14 20:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-14 20:00 [GIT PATCH] Driver Core and sysfs patches for 2.6.17-rc1 Greg KH
2006-04-14 20:09 ` [PATCH 1/7] sysfs: Allow sysfs attribute files to be pollable Greg KH
2006-04-14 20:09   ` Greg KH [this message]
2006-04-14 20:09     ` [PATCH 3/7] BLOCK: delay all uevents until partition table is scanned Greg KH
2006-04-14 20:09       ` [PATCH 4/7] driver core: fix unnecessary NULL check in drivers/base/class.c Greg KH
2006-04-14 20:09         ` [PATCH 5/7] driver core: driver_bind attribute returns incorrect value Greg KH
2006-04-14 20:09           ` [PATCH 6/7] pm: print name of failed suspend function Greg KH
2006-04-14 20:09             ` [PATCH 7/7] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ Greg KH

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=11450453961549-git-send-email-greg@kroah.com \
    --to=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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