From patchwork Wed Mar 9 18:09:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 622121 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p29I7CKv005197 for ; Wed, 9 Mar 2011 18:09:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757072Ab1CISJF (ORCPT ); Wed, 9 Mar 2011 13:09:05 -0500 Received: from 80-190-117-144.ip-home.de ([80.190.117.144]:55052 "EHLO bu3sch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754429Ab1CISJE (ORCPT ); Wed, 9 Mar 2011 13:09:04 -0500 Received: by bu3sch.de with esmtpsa (Exim 4.69) (envelope-from ) id 1PxNon-0007yH-C8; Wed, 09 Mar 2011 19:09:05 +0100 Subject: [PATCH] cbus-tahvo-usb: Fix struct tahvo_usb memory leak on exit From: Michael Buesch To: Tony Lindgren Cc: Felipe Balbi , linux-omap Date: Wed, 09 Mar 2011 19:09:00 +0100 Message-ID: <1299694140.1911.11.camel@marge> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 09 Mar 2011 18:09:06 +0000 (UTC) Index: linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c =================================================================== --- linux-2.6.38-rc7.orig/drivers/cbus/tahvo-usb.c 2011-03-09 18:51:46.240795227 +0100 +++ linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c 2011-03-09 18:52:34.430126706 +0100 @@ -725,6 +725,8 @@ static int __init tahvo_usb_probe(struct static int __exit tahvo_usb_remove(struct platform_device *pdev) { + struct tahvo_usb *tu = platform_get_drvdata(pdev); + dev_dbg(&pdev->dev, "remove\n"); tahvo_free_irq(TAHVO_INT_VBUSON); @@ -734,6 +736,8 @@ static int __exit tahvo_usb_remove(struc #ifdef CONFIG_USB_OTG device_remove_file(&pdev->dev, &dev_attr_otg_mode); #endif + + kfree(tu); tahvo_usb_device = NULL; return 0;