Commit f45f3c1f authored by Johannes Berg's avatar Johannes Berg Committed by Greg Kroah-Hartman

firmware_class: fix typo in error path

In the error path, _request_firmware sets
firmware_p to NULL rather than *firmware_p,
which leads to passing a freed firmware
struct to drivers when the firmware file
cannot be found. Fix this.

Broken by commit f8a4bd34.
Reported-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8488a38f
...@@ -568,7 +568,7 @@ static int _request_firmware(const struct firmware **firmware_p, ...@@ -568,7 +568,7 @@ static int _request_firmware(const struct firmware **firmware_p,
out: out:
if (retval) { if (retval) {
release_firmware(firmware); release_firmware(firmware);
firmware_p = NULL; *firmware_p = NULL;
} }
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment