From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F64BC433EF for ; Fri, 1 Apr 2022 14:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wsuz7VbPeJoubXBbaSkoUp7rszI4ieBdDeMEUHDD7Ck=; b=PlToMsA6ba6Cm9 nND5mI+BAqIlqg6SMGtRBhesk9rNOHhjfTpVLQ4hxWi61Dp9R15lEWHjz0TNaN/EPnd+N0eeu01Lf gp8AZJU6eIzWUdu7c+i1GNI2X+zurkbal8BGaOLyOOB8YYZEJ15+IreAYV8UbxLBvr/C/MT5xD4H3 ZTdbsc3W7DFfxdpmKowmJXTt16qRzQOfOqSxOkiHUZFhDHkT1YvgK6PWcSVcMfmFWx6r52nwYsSpJ 7iMminbdA38o9SjjhG07j7ah+uPDWVelw4SppBOk+hnnzNT0Qih2S4KvGpKsfGhKu7VoMn6LksQSS WMQmH9gpdk/i/ZasQnng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naIXA-006BPJ-8E; Fri, 01 Apr 2022 14:45:53 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1naIQO-0067xC-T9; Fri, 01 Apr 2022 14:38:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0BC7C60EAA; Fri, 1 Apr 2022 14:38:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91837C340EE; Fri, 1 Apr 2022 14:38:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823931; bh=ThPeycLj+4C+6ieQIJwKgxtTuow7S0mzR6CtjXU1XN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hNHn7J4Vo6xFK8Gh0ZOV0lIh9/GMPMe2oINeWOq0XmuomjojTlo14JFzTCKuHYWQo em4+ftMoruT8nIOartKG4gnjgh0ByOuWp9V8YCZwv2O09ZTYjdLSY58XoHL7tXfvoR KvvfF4stSMyNu6WKa6C9ty82mbC8l8CGB9ZsbfJJaJ523XfHRXjWqQxmTg1EMURdWX 2/KhFtPmdUk9KGbhq7kovf9V65W/OkkcW7rOz25R0zAPF/vSHxwsh+MT/mwx35Vee3 78zL77XYIp0e5WgyoBqxiyFeieCQone8mTLnt8Rm9NTGHuMAeWvcaf+sFtPp1U3hPG 4FTQirmpE+Pfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ben Greear , Felix Fietkau , Sasha Levin , lorenzo.bianconi83@gmail.com, ryder.lee@mediatek.com, kvalo@kernel.org, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, matthias.bgg@gmail.com, sean.wang@mediatek.com, deren.wu@mediatek.com, johannes.berg@intel.com, YN.Chen@mediatek.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 23/98] mt76: mt7921: fix crash when startup fails. Date: Fri, 1 Apr 2022 10:36:27 -0400 Message-Id: <20220401143742.1952163-23-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401143742.1952163-1-sashal@kernel.org> References: <20220401143742.1952163-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220401_073853_048256_B7685D73 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ben Greear [ Upstream commit 827e7799c61b978fbc2cc9dac66cb62401b2b3f0 ] If the nic fails to start, it is possible that the reset_work has already been scheduled. Ensure the work item is canceled so we do not have use-after-free crash in case cleanup is called before the work item is executed. This fixes crash on my x86_64 apu2 when mt7921k radio fails to work. Radio still fails, but OS does not crash. Signed-off-by: Ben Greear Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 9eb90e6f0103..30252f408ddc 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -224,6 +224,7 @@ static void mt7921_stop(struct ieee80211_hw *hw) cancel_delayed_work_sync(&dev->pm.ps_work); cancel_work_sync(&dev->pm.wake_work); + cancel_work_sync(&dev->reset_work); mt76_connac_free_pending_tx_skbs(&dev->pm, NULL); mt7921_mutex_acquire(dev); -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel