Skip to contentSkip to conversation

hp-wmi: fix double free

PATCH In review Dan Carpenter 2 participants 2 messages Jan 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hp-wmi: fix double free

kfree(obj) was called earlier.

This was found by smatch and has only been compile tested. :/

drivers/platform/x86/hp-wmi.c +0 -2
@@ -388,8 +388,6 @@ static void hp_wmi_notify(u32 value, voi
 	} else
 		printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n",
 			eventcode);
-
-	kfree(obj);
 }
 
 static int __init hp_wmi_input_setup(void)
#1 lore raw
Quoted 3 lines · Dan Carpenter

kfree(obj) was called earlier.

This was found by smatch and has only been compile tested. :/

I don't see hp-wmi in MAINTAINERS, but in general platform drivers go via the ACPI tree.

It looks like several others have discovered this issue the hard way :-). <http://www.pubbs.net/kernel/201001/14288/>.

Fortunately it has been fixed in the acpi tree and now submitted to Linus. <http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-01/msg02511.html>.

Regards
Alan

Quoted 9 lines
drivers/platform/x86/hp-wmi.c +0 -2
@@ -388,8 +388,6 @@ static void hp_wmi_notify(u32 value, voi
 	} else
 		printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n",
 			eventcode);
-
-	kfree(obj);
 }