linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input synaptics-rmi4: rmi_driver.c storage fix
@ 2014-03-05  3:08 Christopher Heiny
  2014-03-05  8:51 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Heiny @ 2014-03-05  3:08 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Linux Input, Christopher Heiny, Andrew Duggan, Vincent Huang,
	Vivian Ly, Daniel Rosenberg, Linus Walleij, Benjamin Tissoires,
	David Herrmann, Jiri Kosina

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.

Reported-by: Courtney Cavin <courtney.cavin@sonymobile.com>
Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reported-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Linux Walleij <linus.walleij@linaro.org>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>

---

 drivers/input/rmi4/rmi_driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 4406a7f..3552ffb 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -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;
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] input synaptics-rmi4: rmi_driver.c storage fix
  2014-03-05  3:08 [PATCH] input synaptics-rmi4: rmi_driver.c storage fix Christopher Heiny
@ 2014-03-05  8:51 ` Jiri Kosina
  2014-03-05 19:40   ` Christopher Heiny
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2014-03-05  8:51 UTC (permalink / raw)
  To: Christopher Heiny
  Cc: Dmitry Torokhov, Linux Input, Andrew Duggan, Vincent Huang,
	Vivian Ly, Daniel Rosenberg, Linus Walleij, Benjamin Tissoires,
	David Herrmann

On Tue, 4 Mar 2014, Christopher Heiny wrote:

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

I believe you meant devm_kmalloc() here.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] input synaptics-rmi4: rmi_driver.c storage fix
  2014-03-05  8:51 ` Jiri Kosina
@ 2014-03-05 19:40   ` Christopher Heiny
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Heiny @ 2014-03-05 19:40 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Linux Input, Andrew Duggan, Vincent Huang,
	Vivian Ly, Daniel Rosenberg, Linus Walleij, Benjamin Tissoires,
	David Herrmann

On 03/05/2014 12:51 AM, Jiri Kosina wrote:
> On Tue, 4 Mar 2014, Christopher Heiny wrote:
>
>> 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!"



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-05 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05  3:08 [PATCH] input synaptics-rmi4: rmi_driver.c storage fix Christopher Heiny
2014-03-05  8:51 ` Jiri Kosina
2014-03-05 19:40   ` Christopher Heiny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).