diff options
author | Dan Carpenter <[email protected]> | 2022-03-07 15:59:28 +0300 |
---|---|---|
committer | Jason Gunthorpe <[email protected]> | 2022-03-14 20:31:12 -0300 |
commit | 6f6dbb819dfc1a35bcb8b709b5c83a3ea8beff75 (patch) | |
tree | ae35da5c9f501ecd01761ffdd299d99d1e9e9976 /tools/testing/selftests/bpf/progs/test_prog_array_init.c | |
parent | 73f7e05609ece4030f2745c4c0c01e0be6889590 (diff) |
RDMA/irdma: Prevent some integer underflows
My static checker complains that:
drivers/infiniband/hw/irdma/ctrl.c:3605 irdma_sc_ceq_init()
warn: can subtract underflow 'info->dev->hmc_fpm_misc.max_ceqs'?
It appears that "info->dev->hmc_fpm_misc.max_ceqs" comes from the firmware
in irdma_sc_parse_fpm_query_buf() so, yes, there is a chance that it could
be zero. Even if we trust the firmware, it's easy enough to change the
condition just as a hardenning measure.
Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs")
Link: https://lore.kernel.org/r/20220307125928.GE16710@kili
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Shiraz Saleem <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_prog_array_init.c')
0 files changed, 0 insertions, 0 deletions