From patchwork Fri May 12 16:42:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9724591 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B35D601E7 for ; Fri, 12 May 2017 16:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4605428854 for ; Fri, 12 May 2017 16:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A1D028863; Fri, 12 May 2017 16:42:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F164228861 for ; Fri, 12 May 2017 16:42:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933314AbdELQmj (ORCPT ); Fri, 12 May 2017 12:42:39 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34895 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933214AbdELQmf (ORCPT ); Fri, 12 May 2017 12:42:35 -0400 Received: by mail-pf0-f170.google.com with SMTP id n23so27803808pfb.2 for ; Fri, 12 May 2017 09:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=notLWyldkZpe4wOFjAWVVA/xhYmM0+oAJIVsSxbbPgU=; b=JtpfKa86I27rCul99+hdpvCjRCNStKoYJV++P0bhJgE4h8wsM4LEn+R2I3sa/9NPDX dicdJR+j1uuG0LFweZXOZS9zqKjBeiiJyE0x3PiuuMSMGY0w5q0ROru/XJsvcIZbbuds w5fJ7fwfCU2XIGz/L20qdYfhTeN1xLFCjANwE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=notLWyldkZpe4wOFjAWVVA/xhYmM0+oAJIVsSxbbPgU=; b=nTfnTer9Xn8OPF2956SSo799tJRGOnbBCDGtsJzGjSNg5m2HyPD5iO3VUoaIsh7sN7 b4Cnl2hPdwbcqlTVGXBCHM6nRsheTbMrbql7yF9IiPDx8KBnack+BKfbWfopfAbAzZ+/ ydQKCdeCopoOIJkjYsPnNbGlPu0MBjTBSko6ofqpT0fDsQFuJH/3lMqGogkEiLlruAuL N2Fvuo74Ivk4AYT5FYowvElP/1dLeC6cQNe7+D9rAJw+RZtUgxKEjUbXCp3JZboOP09L urxRphLmMU9iegMALpEDqDVU8CxUR7FDPL5TzPEvC+qfdi+yulYmV/SmsuVZvTcRp/Y9 rfnw== X-Gm-Message-State: AODbwcAmfLgnOTmbYBgmaJZhf1wMp3uT5qt6/hPZwFo2MuurvXyyPC3k kuCzz1eUf0JDmKWge4tuyA== X-Received: by 10.99.119.137 with SMTP id s131mr5347625pgc.116.1494607349960; Fri, 12 May 2017 09:42:29 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id u74sm7304499pfk.58.2017.05.12.09.42.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 May 2017 09:42:29 -0700 (PDT) From: Brian Norris To: Ganapathi Bhat , Nishant Sarmukadam Cc: , Dmitry Torokhov , Amitkumar Karwar , Kalle Valo , linux-wireless@vger.kernel.org, Doug Anderson , Brian Norris Subject: [PATCH 06/11] mwifiex: don't leak stashed beacon buffer on reset Date: Fri, 12 May 2017 09:42:03 -0700 Message-Id: <20170512164208.38725-6-briannorris@chromium.org> X-Mailer: git-send-email 2.13.0.rc2.291.g57267f2277-goog In-Reply-To: <20170512164208.38725-1-briannorris@chromium.org> References: <20170512164208.38725-1-briannorris@chromium.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When removing or resetting an mwifiex device, we don't remember to free the saved beacon buffer. Use the (somewhat misleadingly-named) mwifiex_free_priv() helper to handle this. Noticed by kmemleak during tests: echo 1 > /sys/bus/pci/devices/.../reset unreferenced object 0xffffffc09d034a00 (size 256): ... backtrace: [] create_object+0x228/0x3c4 [] kmemleak_alloc+0x54/0x88 [] __kmalloc+0x1cc/0x2dc [] mwifiex_save_curr_bcn+0x80/0x308 [mwifiex] [] mwifiex_ret_802_11_associate+0x4ec/0x5fc [mwifiex] [] mwifiex_process_sta_cmdresp+0xaf8/0x1fa4 [mwifiex] [] mwifiex_process_cmdresp+0x40c/0x510 [mwifiex] [] mwifiex_main_process+0x4a4/0xb00 [mwifiex] [] mwifiex_main_work_queue+0x34/0x40 [mwifiex] Signed-off-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 756948385b60..2ada202c72ec 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -670,8 +670,7 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) mwifiex_clean_auto_tdls(priv); mwifiex_abort_cac(priv); - mwifiex_clean_txrx(priv); - mwifiex_delete_bss_prio_tbl(priv); + mwifiex_free_priv(priv); } }