Skip to contentSkip to conversation

firmware_class: fix typo in error path

PATCH In review Johannes Berg 3 participants 3 messages Aug 18, 2010 – Aug 19, 2010 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware_class: fix typo in error path

From: Johannes Berg <[email protected]>

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.

---
 drivers/base/firmware_class.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/firmware_class.c +1 -1
@@ -568,7 +568,7 @@ static int _request_firmware(const struc
 out:
 	if (retval) {
 		release_firmware(firmware);
-		firmware_p = NULL;
+		*firmware_p = NULL;
 	}
 
 	return retval;
#1 lore raw
Quoted 9 lines · Johannes Berg

From: Johannes Berg <[email protected]>

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.

Nice catch, thanks. I'll queue it up.

greg k-h

#2 lore raw
Quoted 9 lines · Greg KH
Quoted 8 lines · Johannes Berg

From: Johannes Berg <[email protected]>

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.

Quoted 4 lines
Quoted 1 line

Broken by commit f8a4bd3456b988fc73b2c.

Nice catch, thanks. I'll queue it up.

Yep, looks good, thank you for fixing this,

Signature · 1 line
Dmitry