Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1761530rdb; Wed, 31 Jan 2024 08:18:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5Dw55A5Zn9MDRZ9b+1tuSjn3Gfa19v9I5JJv1p608YlDmoo+2KnkXZ34WZRLOmbkmRIWf X-Received: by 2002:a17:90b:88f:b0:295:ab81:2893 with SMTP id bj15-20020a17090b088f00b00295ab812893mr2106919pjb.26.1706717883876; Wed, 31 Jan 2024 08:18:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706717883; cv=pass; d=google.com; s=arc-20160816; b=qWu0dq+efRj/CJ9nSjs+S52t1rk5yI1qErQ+SE4tkD/OicLCikBiU/jZg7SvhQ8dis eMsqChIiWeDaqD8rfj3+qk6xb45lqdR1USjtcyATQ4gYUASAzBj1vjW5ExOrgumFAOcA GBfeO8+9tOLKHZlpQmHkTSlh6WSMuJpnI7SGcsK9JUyBLbf9LQgasTLYegfgrPR0G5yv 6apqUzStEhNDkS1XdAIQF9NnIme8toeregdCSGlWEhUbj8J9HpVyTu+CQnta4zEwFtdt 98+8zZbNNAmfFTvTfBb9PIStB34xBuhF9z4GTupPMcWM1ZdVAYRFlj9kuSarjRy42Ihq 4vzw== 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=ujA/OOWj/HT0MccQRJvV7GwmEzoXdUuYfpobrVNiVko=; fh=rueNOtRxMnE00hhvSwzz9zxDOdsCcRpM1wpW7ZKEwxw=; b=WCrt5E59ojOWgQqx8MSNPxacoY+NoDatLadsE5Yw6dABnV0I/34VJ9NBAcyo9R6vSo U4f/8hrz835b/t/lpGfJd/LIDThV/gPiS09KYhsmvDi4aPBW85iMO2qh3Fg3vbjnc/Su i/ubKoYG1GWrFkYMR65YWz8UZ5+LXA8k8LkMcMSpe3U4xOM/F98+z4jJZMZQjQA5lVOW 77cZKJU/0d/dnf5/eYz7+WbVZ2pDzvL5ToOco/mo+XteDSR9RcKTPsqLpwTj5E+HyoSo /z2/is83AktU72V44nQr+yFKHPZgOZSm+914sY28fOKDWPpCareMsrxGLCExtc1m7c0v kttA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=SAjrJ4Eh; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCXs4+JLps++gV9LUZ+BmgUCh3IkcWIIkGKUUnmq4/fprbwqutcx81UwUL8o8oJckNAcCDF2RMSDeFA/uVdo9uHzdlE0nya/4eoS+qdwoQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l1-20020a17090a72c100b00295c10bd0a8si1516419pjk.177.2024.01.31.08.18.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 08:18:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2893-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=@sipsolutions.net header.s=mail header.b=SAjrJ4Eh; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 3891AB270CD for ; Wed, 31 Jan 2024 15:50:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32AE912BEAF; Wed, 31 Jan 2024 15:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="SAjrJ4Eh" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 43BA912AAF3 for ; Wed, 31 Jan 2024 15:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706716158; cv=none; b=mYhDowTB86qV8CiIXZ4nLMIGybvQ9YBK6ix4z1HTqGiIhJRYz65oCrXV7mjvaxLCYu5nty9knC5Is6PCfw27AhnVgjGTJY+Ahdtvp8VuJNgx75MJgRe8rTM6Scg6zPau23IERGVsIW3V/ku3C2i2/KLpX7jEdAJGME/gPCp226s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706716158; c=relaxed/simple; bh=l8VkQeiKug/L7jNus8NvW7gkJyItBTlW37bVno0m0xg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o5zYeeyJ1zTVOZqzaxCiWcxc5UuMbmpYgPSoXNIMMfyjZhLR2Z3FAtJOzC+fnWe40+ZrFYPw8RK3ff/paORqvKiRcPeW/aHlVtDp+Y5MLj4N63BEnB1OInLtbWNEEwS4b8p3SXa+7rAKsgyGnDmUdsWCLyJ45VgpFD8PcF0fczo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=SAjrJ4Eh; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=ujA/OOWj/HT0MccQRJvV7GwmEzoXdUuYfpobrVNiVko=; t=1706716156; x=1707925756; b=SAjrJ4EhHF/Kd78C3a3gwmPM78ndz3EhXwormrTzKlzoUZm cMphXKF0jmrOrYcyG96Aip+uDXR50pJ8u+QXJgS0h8d/kRJ5KDpQQ/YqvFCEOfpyRTAvAUw8uw0sc bDmHgvRvZbvYjT6IW2ssv6J2Aqy2LZbrbqePQqJSNsgDzZHVVH7nQdYLFOjnTGt9dYF4d6Nyg5i14 msYLvp65h5YAPgOjULACMOfKdw2Xf9oJhZKK3dGHUaOZCC+4YFXFpb+rWUOScGpMhWFXIloYJa6VK 3+v/zzev7gvl2ZY//3iVeNLDuWdgt6mOmgP9inowtA9e3uAXtB5KY702piIX84Rw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rVCpt-00000007JCD-3J2U; Wed, 31 Jan 2024 16:49:13 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 2/2] wifi: mac80211: clarify vif handling in TX dequeue Date: Wed, 31 Jan 2024 16:49:11 +0100 Message-ID: <20240131164910.60066625a239.Idfb6a5a9876f9f631eae760055e1c4018259a971@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240131164910.b54c28d583bc.I29450cec84ea6773cff5d9c16ff92b836c331471@changeid> References: <20240131164910.b54c28d583bc.I29450cec84ea6773cff5d9c16ff92b836c331471@changeid> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg The vif pointer at least looks like it can actually be NULL in some cases such as the monitor-mode vif, causing static checkers to complain with the immediate derefence. In these cases the sta pointer will also be NULL, but clarify it in the code anyway. Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index c2e4ef327377..c3e67e40dc9a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3954,7 +3954,8 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, ieee80211_free_txskb(&local->hw, skb); goto begin; } else { - vif = NULL; + info->control.vif = NULL; + return skb; } break; case NL80211_IFTYPE_AP_VLAN: -- 2.43.0