Skip to content

Commit ef518cc

Browse files
zaxarigregkh
authored andcommitted
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 <[email protected]> Cc: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4623990 commit ef518cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/base/firmware_class.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
919919
mutex_lock(&fw_lock);
920920
fw_load_abort(fw_priv);
921921
mutex_unlock(&fw_lock);
922+
} else if (retval > 0) {
923+
retval = 0;
922924
}
923925

924926
if (is_fw_load_aborted(buf))

0 commit comments

Comments
 (0)