diff options
Diffstat (limited to 'drivers/firmware/dell_rbu.c')
-rw-r--r-- | drivers/firmware/dell_rbu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index b4704e150b28..3a4460265b10 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c | |||
@@ -36,6 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
39 | #include <linux/slab.h> | ||
39 | #include <linux/string.h> | 40 | #include <linux/string.h> |
40 | #include <linux/errno.h> | 41 | #include <linux/errno.h> |
41 | #include <linux/blkdev.h> | 42 | #include <linux/blkdev.h> |
@@ -544,9 +545,12 @@ static void callbackfn_rbu(const struct firmware *fw, void *context) | |||
544 | { | 545 | { |
545 | rbu_data.entry_created = 0; | 546 | rbu_data.entry_created = 0; |
546 | 547 | ||
547 | if (!fw || !fw->size) | 548 | if (!fw) |
548 | return; | 549 | return; |
549 | 550 | ||
551 | if (!fw->size) | ||
552 | goto out; | ||
553 | |||
550 | spin_lock(&rbu_data.lock); | 554 | spin_lock(&rbu_data.lock); |
551 | if (!strcmp(image_type, "mono")) { | 555 | if (!strcmp(image_type, "mono")) { |
552 | if (!img_update_realloc(fw->size)) | 556 | if (!img_update_realloc(fw->size)) |
@@ -568,6 +572,8 @@ static void callbackfn_rbu(const struct firmware *fw, void *context) | |||
568 | } else | 572 | } else |
569 | pr_debug("invalid image type specified.\n"); | 573 | pr_debug("invalid image type specified.\n"); |
570 | spin_unlock(&rbu_data.lock); | 574 | spin_unlock(&rbu_data.lock); |
575 | out: | ||
576 | release_firmware(fw); | ||
571 | } | 577 | } |
572 | 578 | ||
573 | static ssize_t read_rbu_image_type(struct kobject *kobj, | 579 | static ssize_t read_rbu_image_type(struct kobject *kobj, |
@@ -615,7 +621,7 @@ static ssize_t write_rbu_image_type(struct kobject *kobj, | |||
615 | spin_unlock(&rbu_data.lock); | 621 | spin_unlock(&rbu_data.lock); |
616 | req_firm_rc = request_firmware_nowait(THIS_MODULE, | 622 | req_firm_rc = request_firmware_nowait(THIS_MODULE, |
617 | FW_ACTION_NOHOTPLUG, "dell_rbu", | 623 | FW_ACTION_NOHOTPLUG, "dell_rbu", |
618 | &rbu_device->dev, &context, | 624 | &rbu_device->dev, GFP_KERNEL, &context, |
619 | callbackfn_rbu); | 625 | callbackfn_rbu); |
620 | if (req_firm_rc) { | 626 | if (req_firm_rc) { |
621 | printk(KERN_ERR | 627 | printk(KERN_ERR |