[PATCH] firmware_class: fix typo in error path

From: Johannes Berg
Date: Wed Aug 18 2010 - 11:15:28 EST


From: Johannes Berg <johannes.berg@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
drivers/base/firmware_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- wireless-testing.orig/drivers/base/firmware_class.c 2010-08-18 17:02:10.000000000 +0200
+++ wireless-testing/drivers/base/firmware_class.c 2010-08-18 17:13:43.000000000 +0200
@@ -568,7 +568,7 @@ static int _request_firmware(const struc
out:
if (retval) {
release_firmware(firmware);
- firmware_p = NULL;
+ *firmware_p = NULL;
}

return retval;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/