From patchwork Thu Mar 6 01:11:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Heiny X-Patchwork-Id: 3780721 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4142BF540 for ; Thu, 6 Mar 2014 01:12:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1E3C2020A for ; Thu, 6 Mar 2014 01:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0752201F7 for ; Thu, 6 Mar 2014 01:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757270AbaCFBL4 (ORCPT ); Wed, 5 Mar 2014 20:11:56 -0500 Received: from us-mx2.synaptics.com ([192.147.44.131]:46854 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755378AbaCFBL4 (ORCPT ); Wed, 5 Mar 2014 20:11:56 -0500 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 05 Mar 2014 17:11:56 -0800 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Wed, 05 Mar 2014 16:58:05 -0800 X-PGP-Universal: processed; by securemail.synaptics.com on Wed, 05 Mar 2014 16:58:05 -0800 Received: from brontomerus.synaptics.com (10.3.20.103) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 5 Mar 2014 17:11:55 -0800 From: Christopher Heiny To: Dmitry Torokhov CC: Linux Input , Christopher Heiny , Andrew Duggan , Vincent Huang , Vivian Ly , Daniel Rosenberg , Linus Walleij , Benjamin Tissoires , David Herrmann , Jiri Kosina Subject: [PATCH v1.01] input synaptics-rmi4: rmi_driver.c storage fix Date: Wed, 5 Mar 2014 17:11:48 -0800 Message-ID: <1394068308-6284-1-git-send-email-cheiny@synaptics.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.3.20.103] Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not use kfree() on storage allocated with devm_kzalloc(), 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. v1.01 - fix brain hiccup in the commit message. 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }