From patchwork Sun Aug 14 01:34:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 1063792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7E1YdGl010655 for ; Sun, 14 Aug 2011 01:34:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057Ab1HNBec (ORCPT ); Sat, 13 Aug 2011 21:34:32 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:45231 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751721Ab1HNBeb (ORCPT ); Sat, 13 Aug 2011 21:34:31 -0400 X-Authority-Analysis: v=1.1 cv=YhhhcVvq/Bf3xBNEvzTEV9JHGW2mXul7kEbaqsyQnMQ= c=1 sm=0 a=3rvgeqzMqd0A:10 a=xRmbHvA5jp0A:10 a=Zx2FLkwYMp0A:10 a=kj9zAlcOel0A:10 a=mpMdnlmFKti1S5SNY1DT+A==:17 a=yQdBAQUQAAAA:8 a=VwQbUJbxAAAA:8 a=4zzHI1-f3AURGWRpLn0A:9 a=8VQ1RXQzB_o8jqmRRTgA:7 a=CjuIK1q_8ugA:10 a=IcxpeKGZWnEA:10 a=LI9Vle30uBYA:10 a=mpMdnlmFKti1S5SNY1DT+A==:117 X-Cloudmark-Score: 0 X-Originating-IP: 65.28.92.85 Received: from [65.28.92.85] ([65.28.92.85:52778] helo=larrylap.lan) by hrndva-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 92/41-19724-326274E4; Sun, 14 Aug 2011 01:34:30 +0000 Date: Sat, 13 Aug 2011 20:34:27 -0500 From: Larry Finger To: John W Linville Cc: lrodriguez@atheros.com, lrodriguez@atheros.com, vasanth@atheros.com, senthilkumar@atheros.com, ath9k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org Subject: [RFC/RFT] ath9k_htc: Fix memory leak Message-ID: <4e472623.xXZaXUueNVRpfmG+%Larry.Finger@lwfinger.net> User-Agent: Heirloom mailx 12.2 01/07/07 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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]); Sun, 14 Aug 2011 01:34:39 +0000 (UTC) Kmemleak shows the following kind of memory leak for ath9k_htc: unreferenced object 0xffff88004542f200 (size 512): comm "khubd", pid 977, jiffies 4317632516 (age 16855.868s) hex dump (first 32 bytes): 00 00 00 0a 00 00 00 00 00 02 01 05 00 00 02 01 ................ 00 00 00 00 00 00 81 38 02 00 00 00 33 33 30 30 .......8....3300 backtrace: [] create_object+0x127/0x2b0 [] kmemleak_alloc+0x21/0x50 [] __kmalloc_node_track_caller+0x153/0x220 [] __alloc_skb+0x7e/0x170 [] htc_connect_service+0x111/0x200 [ath9k_htc] [] ath9k_init_htc_services+0x240/0x2b0 [ath9k_htc] [] ath9k_htc_probe_device+0xea/0xa50 [ath9k_htc] [] ath9k_htc_hw_init+0xc/0x30 [ath9k_htc] [] ath9k_hif_usb_probe+0x1ca/0x420 [ath9k_htc] [] usb_probe_interface+0xb9/0x160 [usbcore] [] driver_probe_device+0x89/0x1a0 [] __device_attach+0x4b/0x60 [] bus_for_each_drv+0x64/0x90 [] device_attach+0xa1/0xb0 [] bus_probe_device+0x25/0x40 [] device_add+0x55a/0x630 The device is a TP-Link TL-WN722N. The output from lsusb is "ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n". Signed-off-by: Larry Finger Cc: Stable --- This patch certainly fixes a leak. I'm testing to see if there are others. How far back should the patch go for stable kernels? Larry --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: wireless-testing-new/drivers/net/wireless/ath/ath9k/htc_hst.c =================================================================== --- wireless-testing-new.orig/drivers/net/wireless/ath/ath9k/htc_hst.c +++ wireless-testing-new/drivers/net/wireless/ath/ath9k/htc_hst.c @@ -276,7 +276,8 @@ int htc_connect_service(struct htc_targe if (!time_left) { dev_err(target->dev, "Service connection timeout for: %d\n", service_connreq->service_id); - return -ETIMEDOUT; + ret = -ETIMEDOUT; + goto err; } *conn_rsp_epid = target->conn_rsp_epid;