Skip to contentSkip to conversation

input synaptics-rmi4: rmi_driver.c storage fix

PATCH In review Christopher Heiny 2 participants 3 messages Mar 5, 2014

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

PATCH 1/1 input synaptics-rmi4: rmi_driver.c storage fix

Do not use kfree() on storage allocated with devm_kfree(), eliminating kernel panics on device removal.

I'm not sure how this eluded all the patching that's been going on over the past few weeks, but somehow it did.

---

 drivers/input/rmi4/rmi_driver.c | 2 --
 1 file changed, 2 deletions(-)
drivers/input/rmi4/rmi_driver.c +0 -2
index 4406a7f..3552ffb 100644
@@ -743,7 +743,6 @@ static int rmi_driver_remove(struct device *dev)
 		gpio_free(pdata->attn_gpio);
 
 	kfree(data->irq_status);
-	kfree(data);
 
 	return 0;
 }
@@ -942,7 +941,6 @@ err_destroy_functions:
 err_free_mem:
 	if (data->gpio_held)
 		gpio_free(pdata->attn_gpio);
-	kfree(data);
 	return retval < 0 ? retval : 0;
 }
 
#1 lore raw
Quoted 1 line · Christopher Heiny

Do not use kfree() on storage allocated with devm_kfree(),

I believe you meant devm_kmalloc() here.

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw
Quoted 5 lines · Jiri Kosina
Quoted 1 line · Christopher Heiny

Do not use kfree() on storage allocated with devm_kfree(),

I believe you meant devm_kmalloc() here.

I've been trying for an hour to come up with some witty excuse for that brain fart, but came up with nothing but "D'oh! Thanks!"