diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/firmware_class.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 6c9387d646ec..deee871e509c 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -533,12 +533,10 @@ static int _request_firmware(const struct firmware **firmware_p, | |||
533 | return 0; | 533 | return 0; |
534 | } | 534 | } |
535 | 535 | ||
536 | read_lock_usermodehelper(); | 536 | retval = usermodehelper_read_trylock(); |
537 | 537 | if (WARN_ON(retval)) { | |
538 | if (WARN_ON(usermodehelper_is_disabled())) { | ||
539 | dev_err(device, "firmware: %s will not be loaded\n", name); | 538 | dev_err(device, "firmware: %s will not be loaded\n", name); |
540 | retval = -EBUSY; | 539 | goto out_nolock; |
541 | goto out; | ||
542 | } | 540 | } |
543 | 541 | ||
544 | if (uevent) | 542 | if (uevent) |
@@ -573,8 +571,9 @@ static int _request_firmware(const struct firmware **firmware_p, | |||
573 | fw_destroy_instance(fw_priv); | 571 | fw_destroy_instance(fw_priv); |
574 | 572 | ||
575 | out: | 573 | out: |
576 | read_unlock_usermodehelper(); | 574 | usermodehelper_read_unlock(); |
577 | 575 | ||
576 | out_nolock: | ||
578 | if (retval) { | 577 | if (retval) { |
579 | release_firmware(firmware); | 578 | release_firmware(firmware); |
580 | *firmware_p = NULL; | 579 | *firmware_p = NULL; |