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