From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Heiny Subject: [PATCH] input synaptics-rmi4: rmi_driver.c storage fix Date: Tue, 4 Mar 2014 19:08:19 -0800 Message-ID: <1393988899-30076-1-git-send-email-cheiny@synaptics.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from us-mx2.synaptics.com ([192.147.44.131]:3674 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757128AbaCEDI0 (ORCPT ); Tue, 4 Mar 2014 22:08:26 -0500 Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org 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 Reported-by: Dmitry Torokhov Reported-by: Andrew Duggan Signed-off-by: Christopher Heiny Cc: Dmitry Torokhov Cc: Benjamin Tissoires Cc: Linux Walleij Cc: David Herrmann Cc: Jiri Kosina --- 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; }