From patchwork Fri Nov 12 02:49:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 318602 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 oAC2jcHR032209 for ; Fri, 12 Nov 2010 02:45:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360Ab0KLCph (ORCPT ); Thu, 11 Nov 2010 21:45:37 -0500 Received: from mail-vw0-f46.google.com ([209.85.212.46]:38322 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289Ab0KLCpg (ORCPT ); Thu, 11 Nov 2010 21:45:36 -0500 Received: by vws13 with SMTP id 13so764210vws.19 for ; Thu, 11 Nov 2010 18:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=t8CG7lON3sbrlm3laMyDYXD3mQSTld3e7RJVB/X9lcI=; b=JePNMrQclXQdTmDX+8ztpLrU2+SGLLunC+dDNaxH/mlqS1VXZffm1Qj+uUStg74SyH dq9b4xot2HAWeq/4hjJJ+TQ1qoD9qjpAvON29I0jRk3dTw6c6uY/TCeeWuvQCN5u2QfN 5843TYz0Fo3eV1PuRAhOopLDvf3QcVnFopphg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=EOrfsstMapYcWgChbw5xsN2Nm44ca2sNh1fPdaevOY8VYUb/tyYrCuMtXVa+VPpZta qyvVwJuN9j2NreVbbBWhnMqtvhXYUHpMRf5dTnM6h8PdxjLqoGGW1opHNlGwAjW73S5g dShAoRvmRKmm0aUaXZARCbllhg9Hq9lHQVfc0= Received: by 10.220.177.71 with SMTP id bh7mr348610vcb.237.1289529936272; Thu, 11 Nov 2010 18:45:36 -0800 (PST) Received: from [192.168.100.50] (60-251-136-127.HINET-IP.hinet.net [60.251.136.127]) by mx.google.com with ESMTPS id j13sm835150vcr.41.2010.11.11.18.45.33 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 18:45:35 -0800 (PST) Subject: [PATCH 2/3] Input: xpad - fix a memory leak From: Axel Lin To: linux-kernel Cc: Dmitry Torokhov , Marko Friedemann , Christoph Fritz , linux-input@vger.kernel.org In-Reply-To: <1289530116.20782.2.camel@mola> References: <1289530116.20782.2.camel@mola> Date: Fri, 12 Nov 2010 10:49:40 +0800 Message-Id: <1289530180.20782.3.camel@mola> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Nov 2010 02:45:38 +0000 (UTC) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 39c0265..26b2f2b 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -732,7 +732,7 @@ static void xpad_led_disconnect(struct usb_xpad *xpad) if (xpad_led) { led_classdev_unregister(&xpad_led->led_cdev); - kfree(xpad_led->name); + kfree(xpad_led); } } #else @@ -989,6 +989,7 @@ static void xpad_disconnect(struct usb_interface *intf) usb_set_intfdata(intf, NULL); if (xpad) { + kfree(xpad->bdata); xpad_led_disconnect(xpad); input_unregister_device(xpad->dev); xpad_deinit_output(xpad);