diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/devres.c | 3 | ||||
-rw-r--r-- | drivers/base/firmware_class.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c index e8beb8e5b626..05dd307e8f02 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c | |||
@@ -428,6 +428,9 @@ int devres_release_all(struct device *dev) | |||
428 | { | 428 | { |
429 | unsigned long flags; | 429 | unsigned long flags; |
430 | 430 | ||
431 | /* Looks like an uninitialized device structure */ | ||
432 | if (WARN_ON(dev->devres_head.next == NULL)) | ||
433 | return -ENODEV; | ||
431 | spin_lock_irqsave(&dev->devres_lock, flags); | 434 | spin_lock_irqsave(&dev->devres_lock, flags); |
432 | return release_nodes(dev, dev->devres_head.next, &dev->devres_head, | 435 | return release_nodes(dev, dev->devres_head.next, &dev->devres_head, |
433 | flags); | 436 | flags); |
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index fc466531260e..f285f441fab9 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -217,8 +217,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
217 | ret_count = -ENODEV; | 217 | ret_count = -ENODEV; |
218 | goto out; | 218 | goto out; |
219 | } | 219 | } |
220 | if (offset > fw->size) | 220 | if (offset > fw->size) { |
221 | return 0; | 221 | ret_count = 0; |
222 | goto out; | ||
223 | } | ||
222 | if (count > fw->size - offset) | 224 | if (count > fw->size - offset) |
223 | count = fw->size - offset; | 225 | count = fw->size - offset; |
224 | 226 | ||