Skip to content

Commit

Permalink
drivers: base: fw: fix ret value when loading fw
Browse files Browse the repository at this point in the history
When using the user mode helper to load firmwares the function _request_firmware
gets a positive return value from fw_load_from_user_helper and because of this
the firmware buffer is not assigned. This happens only when the return value
is zero. This patch fixes this problem in _request_firmware_load. When the
completion is ready the return value is set to zero.

Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Cc: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Zahari Doychev authored and Greg Kroah-Hartman committed Mar 25, 2015
1 parent 4623990 commit ef518cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
mutex_lock(&fw_lock);
fw_load_abort(fw_priv);
mutex_unlock(&fw_lock);
} else if (retval > 0) {
retval = 0;
}

if (is_fw_load_aborted(buf))
Expand Down

0 comments on commit ef518cc

Please sign in to comment.