]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sock: Correct error checking condition for (assign|release)_proto_idx()
authorZijun Hu <quic_zijuhu@quicinc.com>
Thu, 10 Apr 2025 01:01:27 +0000 (09:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:33 +0000 (11:05 +0100)
commitcafc3c567e4e384830270f9ad859d592e69b7bec
tree12e06723612449a004a72f133a330baead597e06
parentd34f2384d6df11a6c67039b612c2437f46e587e8
sock: Correct error checking condition for (assign|release)_proto_idx()

[ Upstream commit faeefc173be40512341b102cf1568aa0b6571acd ]

(assign|release)_proto_idx() wrongly check find_first_zero_bit() failure
by condition '(prot->inuse_idx == PROTO_INUSE_NR - 1)' obviously.

Fix by correcting the condition to '(prot->inuse_idx == PROTO_INUSE_NR)'

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250410-fix_net-v2-1-d69e7c5739a4@quicinc.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/sock.c