From patchwork Fri Apr 12 12:27:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10898117 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5FC9922 for ; Fri, 12 Apr 2019 12:27:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8979F28E6E for ; Fri, 12 Apr 2019 12:27:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D81428E7B; Fri, 12 Apr 2019 12:27:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 2E8A628E6E for ; Fri, 12 Apr 2019 12:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbfDLM1r (ORCPT ); Fri, 12 Apr 2019 08:27:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfDLM1r (ORCPT ); Fri, 12 Apr 2019 08:27:47 -0400 Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com [149.6.153.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C10F42082E; Fri, 12 Apr 2019 12:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555072066; bh=kOPEc8n97NX7DIoTCNbC5dTFy8hP1jRwfbIo+KcP2VE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnSu+s9uZECinRBKgM4efylYOxygS5eFhQLKCeFCBtA98GFkKAFacrPrgtl6n2L7e MxBojvpClqF6VhiTAkpWxcE/8UwKzAoJriCpml7Tmzr9qMYc9C3ZMwG+BrEZuAyMsY m2epa3WY5z8nBVdKdOkqnArkxA+rM41qK7lGd6DU= From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sgruszka@redhat.com Subject: [PATCH] mt76: usb: fix possible memory leak during suspend/resume Date: Fri, 12 Apr 2019 14:27:16 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 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 Disable mt76u_tx_tasklet at the end of mt76u_stop_queues in order to properly deallocate all pending skbs during suspend/resume phase Fixes: b40b15e1521f ("mt76: add usb support to mt76 layer") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index a3acc070063a..575207133775 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -842,10 +842,10 @@ static void mt76u_stop_tx(struct mt76_dev *dev) void mt76u_stop_queues(struct mt76_dev *dev) { tasklet_disable(&dev->usb.rx_tasklet); - tasklet_disable(&dev->usb.tx_tasklet); - mt76u_stop_rx(dev); + mt76u_stop_tx(dev); + tasklet_disable(&dev->usb.tx_tasklet); } EXPORT_SYMBOL_GPL(mt76u_stop_queues);