Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [bug report] wifi: nl80211/mac80211: clarify link ID in control port TX
Date: Tue, 26 Jul 2022 16:42:41 +0200	[thread overview]
Message-ID: <5cdc7a91910a803ef531ae04ba330541476c0f18.camel@sipsolutions.net> (raw)
In-Reply-To: <Yt/16E0ufa0D0Ziq@kili>

Hi Dan,


On Tue, 2022-07-26 at 17:10 +0300, Dan Carpenter wrote:
>     5885         rcu_read_lock();
>     5886         err = ieee80211_lookup_ra_sta(sdata, skb, &sta);
> 
> For sdata->vif.type == NL80211_IFTYPE_MESH_POINT then "sta" can be NULL.
> Smatch doesn't know the value of sdata->vif.type at this point, and even
> if it did, then it doesn't split the return states up with enough
> granularity for that to make a difference.

Right, but that wouldn't matter anyway?

>     5887         if (err) {
>     5888                 rcu_read_unlock();
>     5889                 return err;
>     5890         }
>     5891 
>     5892         if (!IS_ERR(sta)) {

Since this is all independent of the interface type.

>     5893                 u16 queue = __ieee80211_select_queue(sdata, sta, skb);
>     5894 
>     5895                 skb_set_queue_mapping(skb, queue);
>     5896                 skb_get_hash(skb);
>     5897 
>     5898                 /*
>     5899                  * for MLO STA, the SA should be the AP MLD address, but
>     5900                  * the link ID has been selected already
>     5901                  */
> --> 5902                 if (sta->sta.mlo)
> 
> Which Smatch complains about here.

Makes sense, should be "if (sta && sta->sta.mlo)" then I suppose. I'm on
vacation now, so if you want to send a patch as a reminder that'd be
nice.

I might clean this up later - it's not the first time the strange return
behaviour semantics of ieee80211_lookup_ra_sta() have gotten confusing
...

Thanks!

johannes


  reply	other threads:[~2022-07-26 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 14:10 [bug report] wifi: nl80211/mac80211: clarify link ID in control port TX Dan Carpenter
2022-07-26 14:42 ` Johannes Berg [this message]
2022-07-26 15:39   ` Dan Carpenter

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=5cdc7a91910a803ef531ae04ba330541476c0f18.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=dan.carpenter@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox