diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-13 10:24:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-13 10:24:08 -0700 |
commit | a4dc32374ed6dd56e09039ea8b7151c3a3e2307d (patch) | |
tree | c1a5482db418ff1adb0135ac9d3abd01d138c2ad /drivers/base/devres.c | |
parent | 51feb98d2547a389be2f666514f5bcd658f79eab (diff) | |
parent | 38c7dc373029e4666b17850054dd43c1c96bb264 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
wm97xx_batery: replace driver_data with dev_get_drvdata()
omap: video: remove direct access of driver_data
Sound: remove direct access of driver_data
driver model: fix show/store prototypes in doc.
Firmware: firmware_class, fix lock imbalance
Driver Core: remove BUS_ID_SIZE
sparc: remove driver-core BUS_ID_SIZE
partitions: fix broken uevent_suppress conversion
devres: WARN() and return, don't crash on device_del() of uninitialized device
Diffstat (limited to 'drivers/base/devres.c')
-rw-r--r-- | drivers/base/devres.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c index e8beb8e5b62..05dd307e8f0 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -428,6 +428,9 @@ int devres_release_all(struct device *dev) { unsigned long flags; + /* Looks like an uninitialized device structure */ + if (WARN_ON(dev->devres_head.next == NULL)) + return -ENODEV; spin_lock_irqsave(&dev->devres_lock, flags); return release_nodes(dev, dev->devres_head.next, &dev->devres_head, flags); |