Skip to content
Commit a511f822 authored by Colin Ian King's avatar Colin Ian King Committed by Jason Gunthorpe
Browse files

RDMA/hns: Fix comparison of unsigned long variable 'end' with less than zero

Currently the comparison of end with less than zero is always false
because end is an unsigned long.  Also, replace checks of end with
non-zero with end > 0 as it is possible that the #defined decrement may be
changed in the future causing end to step over zero and go negative.

The initialization of end with 0 is also redundant as this value is never
read and is later set to HW_SYNC_TIMEOUT_MSECS, so fix this by
initializing it with this value to begin with.

Link: https://lore.kernel.org/r/20190531092101.28772-1-colin.king@canonical.com


Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 669cefb6 ("RDMA/hns: Remove jiffies operation in disable interrupt context")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent ecc53f8a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment