Commit 59f7d213 authored by Yury Norov [NVIDIA]'s avatar Yury Norov [NVIDIA] Committed by Leon Romanovsky
Browse files

RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()



The function divides number of online CPUs by num_core_siblings, and
later checks the divider by zero. This implies a possibility to get
and divide-by-zero runtime error. Fix it by moving the check prior to
division. This also helps to save one indentation level.

Signed-off-by: default avatarYury Norov [NVIDIA] <yury.norov@gmail.com>
Link: https://patch.msgid.link/20250604193947.11834-3-yury.norov@gmail.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 16e2707c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment