Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2574747lqp; Mon, 25 Mar 2024 03:11:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX52coPLpTJwFV0GHxm5j8SwHfOIcIFQ8M9CnUsow58syPGxlbhqRvJtYlVyQdjhkk13QNiuuSv6IBZHrHic00wJt1ahACQ4VautywP1w== X-Google-Smtp-Source: AGHT+IE5q/of8LPUIp82kN8uh5xVj5c9UNwAneE+3YbAlArg95aM5IkXhH2ibyoZoK3Zt2+UMRbS X-Received: by 2002:a17:903:1249:b0:1e0:3861:9e41 with SMTP id u9-20020a170903124900b001e038619e41mr8649407plh.19.1711361462008; Mon, 25 Mar 2024 03:11:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711361461; cv=pass; d=google.com; s=arc-20160816; b=xFmgH1pRsddh819OXQk5RZo0sOLOlexmS/hqx0iWx5kZMufH/bCN5q7u4ZQCgB8jOf RLli33aXOVm+NYgv+RY+1x+jgRjUY6kE6G5/EWp9qx2WXiZsbaZ22Ftfyofq7NZbhFut sm9fydqapBlEpii5kOBE5nQKVfSwC6lSzHlKRNfvZVj4BtlR3Mf74+SPTxc8dUcLGLA4 9/aeF/Cs7sY1tp78vqIaZfa9VN2g5fpjNadsrr09t5UmqtSmUVida5wt33nH5Qu7Oxde EOo90U7NAVMDvmSUuMa9cQgSqRVhCSKbW6pEc57KZdlCNlroQMFpfNuhyp2veLZdsBfl eXHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bRcMq1Ff84ZNWSOsHV9L+s10M1FfyM0PBUgrm0Ml1BE=; fh=KN2BaqQWDB6jIy6WiPyZrS3vumZG8uTi023BkZRKAoo=; b=NytgtPWUceAnJUQU0kLgz0Jqx8AnWteu24KN7KVGUV4zNJ6XeHK4S4Yir3+zCAX+NW mLhOLCavf4BKNH6SBacDqqYKzPK+UU6GbZE46aZo4fZSwjbRW3GpE/Xfk/F1RfNspbAl D0TWKA+eEvLgVgP5+qKxA1hZhVwAmpceVUGhCmwCFLxk2bklDW8ZCEGpFce6PXgMOKuz hXVMsgriiwMn/78zopfWyK28Es+cBrigsuEICQOY4A1sZ5x5lCsSetp1GPNGGf/W5XLJ mLZtPGoklbb4/rFEDkjH7qY0/QFK8G9rHkrqWI5V8vM073FEKW4HKMB8dPzrTW8fWUIp SVxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t+nCJZy9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115855-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q7-20020a170902dac700b001e0aeb08ba3si3669976plx.352.2024.03.25.03.11.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t+nCJZy9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115855-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 86660B44C3C for ; Mon, 25 Mar 2024 09:35:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBB7E37F7F2; Mon, 25 Mar 2024 03:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t+nCJZy9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D35D44393; Sun, 24 Mar 2024 23:13:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322018; cv=none; b=Ka371zvUO6zSui4LBAzjoTnrPvyxGRSA0SuF2qwOW51L/7QVe2wgXjbOS3DMCig0sD7SbrIvlwpp7HjKlgvp9ueB3rVd38ETxDKOdAbjHiu0DowUBHaYqOQK3TL56+KTMUwaTpcX7pG35z0ys/s7sSZfjJiRC7Yzj1bRhPHaC5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322018; c=relaxed/simple; bh=sBEVLsaBwotO3KJqTYYim7Q+8BgEHlMSoiIUYwGIHLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iMx/rOq+HvRV+l/KmNwJG2AXXqE9VkBE7Aae66OyN66Rp/GNUI08GMZa/7xAmaeJnxU9hXD0r9bf4uj+Ws2z9Q5o+TgQpPNrbo336tKudopC1Z5YZmhF13O4/txbgranzzd2CEvTxbACq/UNt8FvMu2yZP3MA10xcTW8pXDVBNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t+nCJZy9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73908C43390; Sun, 24 Mar 2024 23:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322018; bh=sBEVLsaBwotO3KJqTYYim7Q+8BgEHlMSoiIUYwGIHLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+nCJZy91ZizS9upVSKGwTw3rQ+zxc0hdsUe058VAUgdPjPhD1yEJQK6YnFhcHnPg barQASs1lP/Tp/i+1UnUH5rl/jonfefRQff6mu1NY4m0OeGC/codFbOO/WtaTG5tK0 1QYSOsyg/piA21Kc6kZcTUGulFZk5bP+v2JwZv3pjV7R5CCnHnyufOBRKnm72FoJ/E 7bRk+hTRbZkLshklmMAH3mKOROcvlPCqcGNXMikvIFFc6yYU4Gn4AG78sbHrORop9w wD5ljDHQLsl+YwAooET6rLFrAmwX8swZojjs7MOleHLhB4qv+S52WNcCsXVzNZFvs2 L4LnlUwdJZtsw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Martin Kaistra , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 6.1 090/451] wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work Date: Sun, 24 Mar 2024 19:06:06 -0400 Message-ID: <20240324231207.1351418-91-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Martin Kaistra [ Upstream commit 1213acb478a7181cd73eeaf00db430f1e45b1361 ] The workqueue might still be running, when the driver is stopped. To avoid a use-after-free, call cancel_work_sync() in rtl8xxxu_stop(). Fixes: e542e66b7c2e ("rtl8xxxu: add bluetooth co-existence support for single antenna") Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://msgid.link/20240111163628.320697-2-martin.kaistra@linutronix.de Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 6dd5ec1e4d8c3..ccac47dd781d6 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6542,6 +6542,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw) if (priv->usb_interrupts) rtl8xxxu_write32(priv, REG_USB_HIMR, 0); + cancel_work_sync(&priv->c2hcmd_work); cancel_delayed_work_sync(&priv->ra_watchdog); rtl8xxxu_free_rx_resources(priv); -- 2.43.0