Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1765384rdd; Thu, 11 Jan 2024 08:36:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpyAa5dNa0fBNYZnegKi8bF02dWT5jqXS2PwQOYgptqj4thyTucnom3573PNaQAlUa2n/4 X-Received: by 2002:a17:906:b42:b0:a23:4e3f:a2fd with SMTP id v2-20020a1709060b4200b00a234e3fa2fdmr801157ejg.5.1704991003044; Thu, 11 Jan 2024 08:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704991003; cv=none; d=google.com; s=arc-20160816; b=jIg2xzObt/TYogQNHCmhDihrO2QcgNIF7rJDw2qDY+onefI+HrP4rYJde7M2hc8iFr lfb83BQEpOj4afehcUmSSoGLKQ/uKE1a7cjKGx4siniee5It/ADcfBz5gpuc/h3TZTPF AaAeWFu50cgXUpZuQD2OH2MzWiXwU0LoeI7lvx9ksO1V4Yp9C847RLkUNPp1wZL5mn3M EK6YSa/9cL92V8tDEwmTQ50d4ByiE0G6MiWXVp94nokSfdCSCTaVMArfxrkRWWA1fmKf IupkYb2n4LUusrp32NlAfrisAD4b5aJR3t412X7txy8916h7W2Ip3lc0CYcDgNzmPREd xHZg== ARC-Message-Signature: i=1; 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:dkim-signature:dkim-signature:from; bh=0OB0s/z6bnRI4QKf5W1H9548PCsW6sTwDXG17hcGIWs=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=VYJyoCVTNiyeuZGO0CXaCy9dUc5WzVWjRwgDyuGN92I+HTS+LargIEFjXMaF5AtTaE ttBPpC94ZrkLGRLdOPEjhTNozzVWKkaOiegZgZiYYLhIXU+xuVcmJJwW/HI8UXuOhdnd j7NuteRmM3/3gtqSZrvaUScNyqZh5A0mMoGBFJfyf+f/cMZQp277jRZH+XiNsISiQb97 9tdeSYzTm48W/GITrEpsuR6eX85m9lhxK9NWizT7EZ/hdD4zeXUb5JZoLqOCmGEaSERZ J8gOuJBZvpAB1eKBTkjX5lZefo8q2H2Vol6g7POpqUwfkkhZjnhh9+CoYkP83VbFAYDy jvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hnG0n5sY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d23-20020a170906371700b00a2a9a1b0598si656283ejc.886.2024.01.11.08.36.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:36:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hnG0n5sY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9BB3B1F214C7 for ; Thu, 11 Jan 2024 16:36:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D77AF50250; Thu, 11 Jan 2024 16:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hnG0n5sY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1x7AAn3R" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 834874F8A1 for ; Thu, 11 Jan 2024 16:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1704990995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0OB0s/z6bnRI4QKf5W1H9548PCsW6sTwDXG17hcGIWs=; b=hnG0n5sYQolgavuPaOKmw5Zk8bg3cxASArzLCtdjRRdHGM8qYniWWAR1d4ItAeE0rrsmL6 A80iQ/zz9pc93fw05C3Q5ThrT/Niz+4ugzgPx0thNfNGe1zyd3l/Ai187fn+1upcchq8+a ndsad3xgg5bJ7sWUF0+LAJunAVV1LHlhD5GWHk4uxBSSSgnJRj9omHKBXxQ5n3NEcpXYlp 4QiKPRbF4d+pyYRnTeVkl5tw0G4HORKD+1bR+FbNYOY//DZmDSKmeLbdAMw7c2yotsSPD1 kyaREnk67BASKKphHp50Tkm2fZtI3lA8emzJeKIdwBUAYhJaWhTTKJ/8b7VjGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1704990995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0OB0s/z6bnRI4QKf5W1H9548PCsW6sTwDXG17hcGIWs=; b=1x7AAn3RYlhI+eZtMTWLVr56HgoFIYN9IQuUtdrLzqakvEjs9oHuSiVzU3hS6x5Ge3SXPd yW45nfmLz/8mWlBw== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v3 1/2] wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work Date: Thu, 11 Jan 2024 17:36:27 +0100 Message-Id: <20240111163628.320697-2-martin.kaistra@linutronix.de> In-Reply-To: <20240111163628.320697-1-martin.kaistra@linutronix.de> References: <20240111163628.320697-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 aac5940936290..757ebd46452eb 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -7480,6 +7480,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.39.2