]> www.infradead.org Git - users/jedix/linux-maple.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)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Apr 2025 23:32:40 +0000 (16:32 -0700)
commitfaeefc173be40512341b102cf1568aa0b6571acd
tree6cd3712f0a0fba38dcc76048f632d3ac6bdc01a2
parent61499764e5cc5918c9f63026d3b7a34c8668d4b8
sock: Correct error checking condition for (assign|release)_proto_idx()

(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>
net/core/sock.c