Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp738098imn; Tue, 26 Jul 2022 08:04:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uRH2QOcsGq98f4xxQ+B5GAaq8PFTxtkY4fngWE4op/78xlaahy6/0zZ1UsTVowNvUHyqzN X-Received: by 2002:a17:902:c950:b0:16d:4035:3bb9 with SMTP id i16-20020a170902c95000b0016d40353bb9mr17255355pla.55.1658847848761; Tue, 26 Jul 2022 08:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658847848; cv=none; d=google.com; s=arc-20160816; b=glg0KblbT0ajbVxV6b1/vL84277W3yb4I8ut8nPRfMVcnIuyAR9fKQMzJ4VZxg/Uk9 0T1l1gglLNMS9Fkaj5vzDHHC/lGI8kOeX4SoJYN/CFRINxUaui5v2AOPCyGakjL5hlfZ PTChwtO1M9bsVShW/8qdnaPKSxM8P6WWUksnliQiQDY8YioNyOcN2XvkgQaOpXroiMcF iK7y378NmiBe4UelZySM2ZU/aPCuRFCgLG8pVT8fc4kuWpNDTaRIr076vIZPWgcJy+MU oy+AggW0fUa25MiaiYEcwk3wHHd+Y4ysVedpfjsF6r6MbLcwkmYngIP82Qf9rUFIFDY8 HG9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=5eImNlI6wDq/9vABSGgcw2zQ/FpvKUSzo/yYKvYnX4o=; b=AumxJromWP9MuG3jslul+ZMBVXqdEbKX8qb15i+CzO8Y+ycbceyz2HUfFWHptzi7Bx V/EKd2XT2Fh2no/sD62YayPBomNjkLsrsnvRhWa+79t5UQFeDY92SUElREpByWXIEYXl ucgOt4qXk4nCt/mFYGshrNvEmAkXrmb03Xc78a0ul79Htg/PiOvEHK4eLbRytEfPLda5 PRuL89ZIPFLDVLhvPWgHbrsXOweUSW7YH1NBaFoEYXv+l8I6C4udxyX9ZRvWbaieUdw8 GNPJE8qg5IfcR+0ysPbPDEeb3258XGZNvzLbD7uE8grn7TbXLdTKVDimBmhWDXw8/Gwg 4Nng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=XoV3zVZo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu6-20020a17090b388600b001ef9099d441si23180284pjb.110.2022.07.26.08.03.56; Tue, 26 Jul 2022 08:04:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=XoV3zVZo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239411AbiGZOmr (ORCPT + 65 others); Tue, 26 Jul 2022 10:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbiGZOmq (ORCPT ); Tue, 26 Jul 2022 10:42:46 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A168F27CC4 for ; Tue, 26 Jul 2022 07:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=5eImNlI6wDq/9vABSGgcw2zQ/FpvKUSzo/yYKvYnX4o=; t=1658846565; x=1660056165; b=XoV3zVZolRV559qchO8Cm2htH7/E4SHp9jgxLhL7vQIADIY aaiKdyrM6P9wmocfOOAB8Qp62ST1H/IZ0QETe1/jyvtRyVVXVBGm2tGyPEg43oShJ8w6HD+yoxjhd uIkkYttULYwpTHGNE+gBoyrJDFbhFna723aSUcaoZiTXFgzF644f5H3Sd3QLPaIwU1oO2CiPRhcoh 7aAaUngfjfOdAVuk8mbQGrUQYam42dwoTh4DgxDzGK5EElU78seNrN/jIirMah16rA4bH/hnN8/R0 p+digaeZGMiNBjKDANYnRkwUgOUwEAKqApZR9UwLYWdDxLaDJtZwrRYhWNv5vvQw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oGLli-008jP2-1R; Tue, 26 Jul 2022 16:42:42 +0200 Message-ID: <5cdc7a91910a803ef531ae04ba330541476c0f18.camel@sipsolutions.net> Subject: Re: [bug report] wifi: nl80211/mac80211: clarify link ID in control port TX From: Johannes Berg To: Dan Carpenter Cc: linux-wireless@vger.kernel.org Date: Tue, 26 Jul 2022 16:42:41 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Dan, On Tue, 2022-07-26 at 17:10 +0300, Dan Carpenter wrote: > 5885 rcu_read_lock(); > 5886 err =3D ieee80211_lookup_ra_sta(sdata, skb, &sta); >=20 > For sdata->vif.type =3D=3D NL80211_IFTYPE_MESH_POINT then "sta" can be NU= LL. > 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=20 > 5892 if (!IS_ERR(sta)) { Since this is all independent of the interface type. > 5893 u16 queue =3D __ieee80211_select_queue(sdata, st= a, skb); > 5894=20 > 5895 skb_set_queue_mapping(skb, queue); > 5896 skb_get_hash(skb); > 5897=20 > 5898 /* > 5899 * for MLO STA, the SA should be the AP MLD addr= ess, but > 5900 * the link ID has been selected already > 5901 */ > --> 5902 if (sta->sta.mlo) >=20 > 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