From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=none; arc=none (Message is not ARC signed); dmarc=fail (Used From Domain Record) header.from=toke.dk policy.dmarc=none From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Jamal Hadi Salim , netdev@vger.kernel.org Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Victor Nogueira , cake@lists.bufferbloat.net In-Reply-To: References: Date: Thu, 08 Oct 2026 12:24:33 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87v77csd5q.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GZUJMWGS6IRYRLYN5MJCXTXLFUNXHC6W X-Message-ID-Hash: GZUJMWGS6IRYRLYN5MJCXTXLFUNXHC6W X-MailFrom: toke@toke.dk X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] Re: [PATCH net-next 4/4] net/sched/sch_cake: drop dead nla_nest_end() error check List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Jamal Hadi Salim writes: > cake_dump_class_stats() closes the TCA_STATS_APP nest with > > if (nla_nest_end(d->skb, stats) < 0) > return -1; > > nla_nest_end() never returns a negative value: it has a single > `return skb->len;` and no error path (that is why the overflow-aware > nla_nest_end_safe() helper was later added). The '< 0' test can never > be true, so the 'return -1' is unreachable dead code. > > Drop the check and close the nest with the bare statement, matching the > sibling cake nests in the same file. > > This issue was discovered while fixing a bug on the gate action, see: > https://lore.kernel.org/netdev/QDISC-H19Z.v1.20261001053234@mojatatu.com/ > > Conditions to recreate the bug: > - not runtime observable: the issue is found by inspection. > > Reviewed-by: Victor Nogueira > Signed-off-by: Jamal Hadi Salim Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen