[PATCH 2/3] firmware_class: fix typo in error path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Monday, August 23, 2010 - 9:24 pm

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 drivers/base/firmware_class.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index c8a44f5..40af43e 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -568,7 +568,7 @@ static int _request_firmware(const struct firmware **firmware_p,
 out:
 	if (retval) {
 		release_firmware(firmware);
-		firmware_p = NULL;
+		*firmware_p = NULL;
 	}
 
 	return retval;
-- 
1.7.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] driver core fixes for .36-rc2, Greg KH, (Mon Aug 23, 9:05 pm)
[PATCH 1/3] kobject: Break the kobject namespace defs into ..., Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 2/3] firmware_class: fix typo in error path, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 3/3] kobject_uevent: fix typo in comments, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)