diff options
author | Zahari Doychev <zahari.doychev@linux.com> | 2015-03-10 05:45:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-25 09:49:10 -0400 |
commit | ef518cc8aa4427043efe21cb2f0799be9cb1d74d (patch) | |
tree | 10aa0001699947341c554464852d1029574f2404 | |
parent | 46239902ecddd4690b6d800da258d0ab65a5cb78 (diff) |
drivers: base: fw: fix ret value when loading fw
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>
-rw-r--r-- | drivers/base/firmware_class.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 1b5bfd7cf6b6..171841ad1008 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -919,6 +919,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, | |||
919 | mutex_lock(&fw_lock); | 919 | mutex_lock(&fw_lock); |
920 | fw_load_abort(fw_priv); | 920 | fw_load_abort(fw_priv); |
921 | mutex_unlock(&fw_lock); | 921 | mutex_unlock(&fw_lock); |
922 | } else if (retval > 0) { | ||
923 | retval = 0; | ||
922 | } | 924 | } |
923 | 925 | ||
924 | if (is_fw_load_aborted(buf)) | 926 | if (is_fw_load_aborted(buf)) |