Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9061269rwd; Wed, 21 Jun 2023 02:26:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7X5SQ748Pfhp46ha79qdg6u2TgLy+Tri9KKA+rndIFdQLEBlmnJm4mcbqYODhYGzdouzwu X-Received: by 2002:a17:902:da8b:b0:1b6:78a1:93c7 with SMTP id j11-20020a170902da8b00b001b678a193c7mr4959160plx.39.1687339586278; Wed, 21 Jun 2023 02:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687339586; cv=none; d=google.com; s=arc-20160816; b=geWzXGpG4AFpSryEBbUdAPzuofoLt/Q5a22mpszdv3eakN4NfjmuqD7pT5kgc36+mH NqH8GHZ/hUQVhf+cc9dfLlj0vgariGBCPhe55085VFhP0X1Sjnkw9saCsO9AG2nVo/CD HSlXsGw5mYyJOxDDflvwpNIJ2mZrXhXJR1PRzvlcqsZJEx+TTqDAHyc+DdD0YrmCOhps fLVm0BWNHyxVUJb+CiTs+jH/Wpwa4IVSjqo+YlSTaUU29kMwx3ZraFrsNpcnF19VeAnn phdcZe/zsE/vfvMDTbKgD0ttb3WT6yFhwaAamhRpWDTNCRJ2Vw9s6EF7vCoos1PWWZNN HHFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oDvZXCvxpLuuDDgHCVXgl5cE7EXMbEjEY77S7+sNfJE=; b=WjnEjHaFaRbQLUd06O7oRr5ePvDVtmMpb7hkIgZfv1TzcFkHjn38gqAc1lIl/hzdVU 4hR7NQL/9pIwT/uHpRiD1KE4crhxnVg+uGTtW9g7Mw5a114SPHf2be8MOI7M8qRgG+QI GQDnAO/7aepIligpkUzVsoLECMkDmAPzjcCvE0YNTh4Uvktr5Wu1/1HJtdSOC2q0ca9u 96gfvN5bvd74pUI0q3vMx4qKWOFDeWXW5xmI4mmyX1X/HZ0xNR265oUxPh+O2xFLy/wS ngOT+tB6eBCz57Im8gA/Rpm4O7cwt+KXbAfNCgr5RejPkDy8zp908dboXgu3LH8AsOvY wxRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=t8Rl9MEC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170903124500b001b55048e61asi938114plh.612.2023.06.21.02.26.17; Wed, 21 Jun 2023 02:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=t8Rl9MEC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbjFUJXy (ORCPT + 60 others); Wed, 21 Jun 2023 05:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbjFUJXx (ORCPT ); Wed, 21 Jun 2023 05:23:53 -0400 Received: from forward103a.mail.yandex.net (forward103a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5744419B3 for ; Wed, 21 Jun 2023 02:23:21 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:f15:0:640:e80a:0]) by forward103a.mail.yandex.net (Yandex) with ESMTP id 98FFB46D2A; Wed, 21 Jun 2023 12:23:16 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id FNeUOg7DXeA0-qmIzZr1i; Wed, 21 Jun 2023 12:23:16 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687339396; bh=oDvZXCvxpLuuDDgHCVXgl5cE7EXMbEjEY77S7+sNfJE=; h=Message-ID:Date:Cc:Subject:To:From; b=t8Rl9MECBKHOSAANG80zI9dLuvcrRqLP63coq24QdD25npsThnGawGFmC46qDeqHh Rue9zJXm2mGn/d9mgnloZeUzOBSi25dMsydBgg3LjjQ2yXRhLqQk1qHZ8yNy1Q4e4p MLjeeowQgmaK3+yvHkx/WpdoG75Xet06cKAvvPag= Authentication-Results: mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Ping-Ke Shih Cc: Sascha Hauer , Kalle Valo , linux-wireless@vger.kernel.org, Dmitry Antipov Subject: [PATCH 1/3] [v4] wifi: rtw88: delete timer and free skb queue when unloading Date: Wed, 21 Jun 2023 12:22:13 +0300 Message-ID: <20230621092313.65965-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix possible crash and memory leak on driver unload by deleting TX purge timer and freeing C2H queue in 'rtw_core_deinit()', shrink critical section in the latter by freeing COEX queue out of TX report lock scope. Signed-off-by: Dmitry Antipov --- v4: adjust to match series v3: shrink critical section in rtw_core_deinit() (Ping-Ke Shih) v2: fix title and commit message (Kalle Valo) --- drivers/net/wireless/realtek/rtw88/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 9447a3aae3b5..c190598c47c3 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -2180,10 +2180,12 @@ void rtw_core_deinit(struct rtw_dev *rtwdev) release_firmware(wow_fw->firmware); destroy_workqueue(rtwdev->tx_wq); + timer_delete_sync(&rtwdev->tx_report.purge_timer); spin_lock_irqsave(&rtwdev->tx_report.q_lock, flags); skb_queue_purge(&rtwdev->tx_report.queue); - skb_queue_purge(&rtwdev->coex.queue); spin_unlock_irqrestore(&rtwdev->tx_report.q_lock, flags); + skb_queue_purge(&rtwdev->coex.queue); + skb_queue_purge(&rtwdev->c2h_queue); list_for_each_entry_safe(rsvd_pkt, tmp, &rtwdev->rsvd_page_list, build_list) { -- 2.41.0