All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 11/16] wifi: mac80211: use correct iftype HE cap
Date: Sun,  4 Jun 2023 12:11:23 +0300	[thread overview]
Message-ID: <20230604120651.0e908e5c5fdd.Iac142549a6144ac949ebd116b921a59ae5282735@changeid> (raw)
In-Reply-To: <20230604091128.609335-1-gregory.greenman@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

We already check that the right iftype capa exists,
but then don't use it. Assign it to a variable so we
can actually use it, and then do that.

Fixes: bac2fd3d7534 ("mac80211: remove use of ieee80211_get_he_sta_cap()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 net/mac80211/he.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index 729f261520c7..0322abae0825 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -3,7 +3,7 @@
  * HE handling
  *
  * Copyright(c) 2017 Intel Deutschland GmbH
- * Copyright(c) 2019 - 2022 Intel Corporation
+ * Copyright(c) 2019 - 2023 Intel Corporation
  */
 
 #include "ieee80211_i.h"
@@ -114,6 +114,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
 				  struct link_sta_info *link_sta)
 {
 	struct ieee80211_sta_he_cap *he_cap = &link_sta->pub->he_cap;
+	const struct ieee80211_sta_he_cap *own_he_cap_ptr;
 	struct ieee80211_sta_he_cap own_he_cap;
 	struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
 	u8 he_ppe_size;
@@ -123,12 +124,16 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
 
 	memset(he_cap, 0, sizeof(*he_cap));
 
-	if (!he_cap_ie ||
-	    !ieee80211_get_he_iftype_cap(sband,
-					 ieee80211_vif_type_p2p(&sdata->vif)))
+	if (!he_cap_ie)
 		return;
 
-	own_he_cap = sband->iftype_data->he_cap;
+	own_he_cap_ptr =
+		ieee80211_get_he_iftype_cap(sband,
+					    ieee80211_vif_type_p2p(&sdata->vif));
+	if (!own_he_cap_ptr)
+		return;
+
+	own_he_cap = *own_he_cap_ptr;
 
 	/* Make sure size is OK */
 	mcs_nss_size = ieee80211_he_mcs_nss_size(he_cap_ie_elem);
-- 
2.38.1


  parent reply	other threads:[~2023-06-04  9:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04  9:11 [PATCH 00/16] cfg80211/mac80211 patches from our internal tree 2023-06-04 gregory.greenman
2023-06-04  9:11 ` [PATCH 01/16] wifi: mac80211: use u64 to hold enum ieee80211_bss_change flags gregory.greenman
2023-06-04  9:11 ` [PATCH 02/16] wifi: mac80211: refactor ieee80211_select_link_key() gregory.greenman
2023-06-04  9:11 ` [PATCH 03/16] wifi: mac80211: don't translate beacon/presp addrs gregory.greenman
2023-06-04  9:11 ` [PATCH 04/16] wifi: mac80211: mlme: fix non-inheritence element gregory.greenman
2023-06-04  9:11 ` [PATCH 05/16] wifi: mac80211: provide a helper to fetch the medium synchronization delay gregory.greenman
2023-06-04  9:11 ` [PATCH 06/16] wifi: cfg80211: reject bad AP MLD address gregory.greenman
2023-06-04  9:11 ` [PATCH 07/16] wifi: mac80211_hwsim: check the return value of nla_put_u32 gregory.greenman
2023-06-04  9:11 ` [PATCH 08/16] wifi: mac80211: recalc min chandef for new STA links gregory.greenman
2023-06-04  9:11 ` [PATCH 09/16] wifi: mac80211: move sta_info_move_state() up gregory.greenman
2023-06-04  9:11 ` [PATCH 10/16] wifi: mac80211: batch recalc during STA flush gregory.greenman
2023-06-04  9:11 ` gregory.greenman [this message]
2023-06-04  9:11 ` [PATCH 12/16] wifi: mac80211: add helpers to access sband iftype data gregory.greenman
2023-06-04  9:11 ` [PATCH 13/16] wifi: mac80211: remove typecast in a call to ieee80211_config_bw() gregory.greenman
2023-06-06 13:18   ` Nicolas Escande
2023-06-06 13:22     ` Johannes Berg
2023-06-04  9:11 ` [PATCH 14/16] wifi: mac80211: Modify type of "changed" variable gregory.greenman
2023-12-02 17:56   ` Jeff Johnson
2023-12-03 16:48     ` Jeff Johnson
2023-12-03 18:42       ` Johannes Berg
2023-06-04  9:11 ` [PATCH 15/16] wifi: mac80211_hwsim: Fix possible NULL dereference gregory.greenman
2023-06-04  9:11 ` [PATCH 16/16] wifi: mac80211: stop warning after reconfig failures gregory.greenman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230604120651.0e908e5c5fdd.Iac142549a6144ac949ebd116b921a59ae5282735@changeid \
    --to=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.