diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-10-22 15:12:09 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-10-23 18:49:55 -0700 |
| commit | 05774d7e4201b673b415d65a1344dc396e7c00e1 (patch) | |
| tree | 5cbb9e6e440a8e4a2604ad08840c86608de98e0c /net/strparser/strparser.c | |
| parent | 9ff86092655f7a22cc115188e3bf1b88ef49ec9e (diff) | |
tcp: Remove unnecessary null check in tcp_inbound_md5_hash()
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@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Link: https://patch.msgid.link/20251022221209.19716-1-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/strparser/strparser.c')
0 files changed, 0 insertions, 0 deletions