[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVpQUAuCGendBRk1DCxoMyTz4vh6S0SbyY6GmSQoGdpG6RQ1A@mail.gmail.com>
Date: Wed, 22 Oct 2025 16:12:46 -0700
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
Neal Cardwell <ncardwell@...gle.com>, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
David Ahern <dsahern@...nel.org>, Dmitry Safonov <0x7f454c46@...il.com>,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH net-next] tcp: Remove unnecessary null check in tcp_inbound_md5_hash()
On Wed, Oct 22, 2025 at 3:12 PM Eric Biggers <ebiggers@...nel.org> wrote:
>
> The 'if (!key && hash_location)' check in tcp_inbound_md5_hash() implies
> that hash_location might be null. However, later code in the function
> dereferences hash_location anyway, without checking for null first.
> Fortunately, there is no real bug, since tcp_inbound_md5_hash() is
> called only with non-null values of hash_location.
>
> Therefore, remove the unnecessary and misleading null check of
> hash_location. This silences a Smatch static checker warning
> (https://lore.kernel.org/netdev/aPi4b6aWBbBR52P1@stanley.mountain/)
>
> Also fix the related comment at the beginning of the function.
>
> Signed-off-by: Eric Biggers <ebiggers@...nel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Powered by blists - more mailing lists