Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18857861rwd; Wed, 28 Jun 2023 01:25:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ600sbkwS5Uw5QGczFwKuOUfSoIfOnklAzdragn9+CooeiciQm6/nPG2/RfdGyCjXMpeQHp X-Received: by 2002:a05:6402:517b:b0:51a:5c1d:5c06 with SMTP id d27-20020a056402517b00b0051a5c1d5c06mr16989403ede.42.1687940737550; Wed, 28 Jun 2023 01:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687940737; cv=none; d=google.com; s=arc-20160816; b=bCMSgqrgpZj05U+C8ZVAkRe8CdbjKmZeNwPnlcPTqeG8lM3PH7jbG6s03t8DC+t879 6OqRBQV4hsCIDy2yQ5ucb5F5KvvHbOSPGcqMiZZQAeatVYQpnnuGP6L1gWNZRTjCKvPY 5+xDfawnVusnvMC0bUcWAFbOT0cLgyw06B92BolNZrkb4zX9XoP6hOG/cZ2enypG20l8 SDz3kMVzebVrlpLNu4DaggKfs/oPEjq5TkOHh0FUPFfHmMPROCopyjsxzVCYRf35Usf6 qngiqkIQ5v0uzt341IftuZbmXLvQ1LoC2pYjN6sZ67YlvtH5TiYnhtMNpOu3yIwzQm3Y H3UA== 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=LNigIxmaIJovn4+mpBAx/a7XSSUii5fvrGrWuxN0Z2k=; fh=cTpNU0LjQh8M8I5sMCnA+eSq8E8l2POw8Wkr6J46dzM=; b=j0E0Y6qwFIEGwZ3qGSlRi1OXGbjqv5jiXJa9GQ7rsuZkxPIf1cDO1rm6fgWRXh9fhR Ms0cqcZgIFyiLe6Fx6mO+rK4fUPid5Jgn+dCPJxUKm12kT0nEZkwzINkUVnoSDwpj7f9 CgpiUkjF6YAFR1j2RhB1OBJjF0J5cCGv6RmLgsNc9p7tdRNWy9ksvSaZq56NwXQC3Vli mvApskZJ/dz6I4DT831xnuCWPi+uSLGchZ42Ne+K5HMz8VX1x693Fng9Dg/gE9xSmyAh qBTWv8AhTsn2n+lkHt2c3RS1oUCkDiC+tMBC86AASgcmHvWODHzShjQ71TAimtE79jAA Q3ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=bJ5Mb2k8; 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 bm27-20020a0564020b1b00b0051dcf2e9284si604911edb.474.2023.06.28.01.25.20; Wed, 28 Jun 2023 01:25:37 -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=bJ5Mb2k8; 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 S232500AbjF1IY1 (ORCPT + 59 others); Wed, 28 Jun 2023 04:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233492AbjF1IUO (ORCPT ); Wed, 28 Jun 2023 04:20:14 -0400 Received: from forward203a.mail.yandex.net (forward203a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d203]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE173C07 for ; Wed, 28 Jun 2023 01:11:48 -0700 (PDT) Received: from forward103a.mail.yandex.net (forward103a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d103]) by forward203a.mail.yandex.net (Yandex) with ESMTP id 2EC5047D1E for ; Wed, 28 Jun 2023 10:24:01 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:170e:0:640:d60c:0]) by forward103a.mail.yandex.net (Yandex) with ESMTP id 3458E46D33; Wed, 28 Jun 2023 10:23:57 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id uNGuVj7DSKo0-2xHa7ZGi; Wed, 28 Jun 2023 10:23:56 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687937036; bh=LNigIxmaIJovn4+mpBAx/a7XSSUii5fvrGrWuxN0Z2k=; h=Message-ID:Date:Cc:Subject:To:From; b=bJ5Mb2k8TmBXIdm7SFEhxuoyy7qw9fkqnjEuWJ8T5SgtmzZvbfIkbulyqR3Lln3mt AQQFAjtKLjAxuMDTndijm2snedpIIXKxC4E0decS/ab7zNlZod/XcWwq1DkOZaMIKZ DSRlAI3egHKVRnDDL25dFClNXzSUbmiDPoiTKpF4= Authentication-Results: mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Po-Hao Huang Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Kalle Valo , Dmitry Antipov Subject: [PATCH 1/4] [v6] wifi: rtw88: delete timer and free skb queue when unloading Date: Wed, 28 Jun 2023 10:23:15 +0300 Message-ID: <20230628072327.167196-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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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. Reviewed-by: Ping-Ke Shih Signed-off-by: Dmitry Antipov --- v6: adjust to match series v5: adjust to match recent changes 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 c853e2f2d448..c2ddb4d382af 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -2183,10 +2183,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