Skip to contentSkip to conversation

Input: wacom: NULL dereference on allocation failure

PATCH In review Dan Carpenter 2 participants 2 messages Apr 4, 2012

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

PATCH 1/1 Input: wacom: NULL dereference on allocation failure

If the "wac_i2c" alloction fails, then it leads to a NULL dereference.

drivers/input/touchscreen/wacom_i2c.c +1 -1
index b29f064..b8ca4a6 100644
@@ -252,7 +252,7 @@ static int __devinit wacom_i2c_probe(struct i2c_client *client,
 err_free_irq:
 	free_irq(client->irq, wac_i2c);
 err_free_mem:
-	input_free_device(wac_i2c->input);
+	input_free_device(input);
 	kfree(wac_i2c);
 
 	return error;
maintainer
#1 lore raw
Quoted 3 lines · Dan Carpenter

If the "wac_i2c" alloction fails, then it leads to a NULL dereference.

Doh! I'll fold it up into original...

Thanks Dan!

Quoted 14 lines
drivers/input/touchscreen/wacom_i2c.c +1 -1
index b29f064..b8ca4a6 100644
@@ -252,7 +252,7 @@ static int __devinit wacom_i2c_probe(struct i2c_client *client,
 err_free_irq:
 	free_irq(client->irq, wac_i2c);
 err_free_mem:
-	input_free_device(wac_i2c->input);
+	input_free_device(input);
 	kfree(wac_i2c);
 
 	return error;
Signature · 1 line
Dmitry