Re: [PATCH] RDMA/irdma: prevent some integer underflows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 07, 2022 at 03:59:28PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Acked-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
> ---
>  drivers/infiniband/hw/irdma/ctrl.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Applied to for-next, thanks

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux