Browse Source

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 f8a4bd3456b988fc73b2c.

Reported-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Johannes Berg 15 years ago
parent
commit
f45f3c1f3f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/base/firmware_class.c

+ 1 - 1
drivers/base/firmware_class.c

@@ -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;