Skip to content
Commit 16a5bed6 authored by Alexey Kodanev's avatar Alexey Kodanev Committed by Sasha Levin
Browse files

RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store()

[ Upstream commit 7a7b7f57 ]

strnlen() may return 0 (e.g. for "\0\n" string), it's better to
check the result of strnlen() before using 'len - 1' expression
for the 'buf' array index.

Detected using the static analysis tool - Svace.

Fixes: dc3b66a0

 ("RDMA/rtrs-clt: Add a minimum latency multipath policy")
Signed-off-by: default avatarAlexey Kodanev <aleksei.kodanev@bell-sw.com>
Link: https://lore.kernel.org/r/20240221113204.147478-1-aleksei.kodanev@bell-sw.com
Acked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ed3e66d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment