Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2362733lqp; Sun, 24 Mar 2024 15:51:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4/jVEMTqqWbCKISbYZ/+zs3P+y/1IyRAdXhglWyvEr7yGijAETB8k+69bd0sqGKkpdAdfcCvmUlifP3fkbGPYm6TUj9nKnhCU8JRD8A== X-Google-Smtp-Source: AGHT+IFTS9XRrihRYCw8gYAhQqudCCxjOHMxicNezc82WlmL5T72Y5mO9oL84eVeRYVckv+tg7+Q X-Received: by 2002:a05:6214:508a:b0:696:3fbc:510 with SMTP id kk10-20020a056214508a00b006963fbc0510mr8166960qvb.40.1711320643749; Sun, 24 Mar 2024 15:50:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711320643; cv=pass; d=google.com; s=arc-20160816; b=U0afQwcnEO+uOVjpLKgRsQ3avUmhlsXV4XhIKf7iJKDHE3icrJCE5/2yhzKWbpL5Na 0Lwa3uBylYPtd0SP1DlJui2Yl+EBczG7Pvr4fPUsBANiDH9ZTNMx/45W+gzq9i7dZ6mB KKlPiUT+nzuE2crQxr844eoYjcajgiMd05zF8UvD49ptxJoUmu98h85Kq/DBufBRlrQ4 ZqeXPJZUIXeqcBPlPQzZWI5SPsXVxNgoLzWe+es7HuSHdRF25ZTaZExLDMQXgv/8O4mf 8ByxQkkE4fbMSEK/nGuaRsogooN3vj7q36AYRKu9EV/uTeoAgzgxd86wjOmzhyOEQhfS o55Q== 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=twKHJgk7rcgc6NwaSeHjQyk1OdY8yJ2L6J1Hi9cHJ1Y=; fh=KN2BaqQWDB6jIy6WiPyZrS3vumZG8uTi023BkZRKAoo=; b=jmF4PZi2iHAfdQNZEnjDdcf0oZgxVZaUFpiaRcp+ZvSXM6Np8jMqs0UMHw60E5ZE1V eGdkeTR8V5T4u2I+QydRCnvyXKxuekGo4q52XuHl3GyAGfl0LeI83BIgo2LYH//1r1cX dPKK4zV7Zsn/RD8Pscpxf8H1bNk6Dn73+u1SvS8mvcpecbh+Ojw72jLyRjRh6eQAfeEA O2ucHvHLv+ULlF9PPI4+azfCTxwHZJLU2OPsHof/0ZfVENYUyAE6xr/Fw1IForwwbzZi IDLfWrCcwnh98S6Rbd8CaSPK61fgrLmGiKzGsUsWj0BQ+MmLfk/y1Da4QLF4lS6ZVnyX kG5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dcdN++al; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 10-20020a0562140d4a00b0068f7fca91c9si6584741qvr.164.2024.03.24.15.50.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dcdN++al; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112952-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6AF901C21199 for ; Sun, 24 Mar 2024 22:50:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B840184FAA; Sun, 24 Mar 2024 22:36:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dcdN++al" 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 D482483CA8; Sun, 24 Mar 2024 22:36:04 +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=1711319764; cv=none; b=ggoJh2j+lyzou+ZhmN5mN7Cp2UEc/x0hzUI9BMRf78adDVkfUrgrUU7M6C8nlPNoio+ghMCpLTigo8tmtRUalBEpq572xjfcqO+Ey3Qhr/mesygL2S4Vd7waijOGRA5szDmQvsCV+isam4VZRirmosvM+ZoE4GBdPPqiC7H5NQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319764; c=relaxed/simple; bh=HRsI8JAt342So7xUBYg8KsqVHOOsA3e9WgoFFAH9MKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JZ+eiyLgaQtNTxdra708ZREQwLcVyCrI48UZRYmBtdzH3THILYAUElvyI/H9u6Vyo1/TJ7XCPoo2hocpqxxRIKzw3+oamumkvJ7zwhlQOm1HqFq119m5A9cjoqMNBilZkTPCx6wE/XTe1s0mN7EyGX4Nc6AfsAqB5kAAKbGGCQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dcdN++al; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 072F1C433C7; Sun, 24 Mar 2024 22:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319764; bh=HRsI8JAt342So7xUBYg8KsqVHOOsA3e9WgoFFAH9MKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dcdN++alNhgSYgN1n6IUBhw39owBp81TUMSt4hHKV91bHMVfEHtqXPI2fhLqTHVu7 9Ny6/kZ+XJjevJm082NQpsIpdSFYpraMUfcdpZd8GTT41me/pfISbAKc7g0pGHxCrA 0R80WbjfryEBnXlXOTttHh967OVoahwdSyiCcO9dB3oiooDRx6X5VgpvCRVrdjLIT6 41s3eQoZkRJZorzMYYn2X5yjZmStjHPacKSq6hWEeDtD6nXVNtfZniCsvcXjhcUzss q5LMtL2y3PCUuWwLpfE0Xq7DYk3O28jgXA6q1e5JeXp4F7accryGCExBVtfHDhA6f4 zCcO+QeQ52Ivg== 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.8 065/715] wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work Date: Sun, 24 Mar 2024 18:24:04 -0400 Message-ID: <20240324223455.1342824-66-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 180907319e8cd..04df0f54aa667 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -7304,6 +7304,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