Re: [PATCH] RDMA/erdma: signedness bug in erdma_request_vectors()

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

 





On 6/8/22 9:47 PM, Dan Carpenter wrote:
The dev->attrs.irq_num variable is a u32 so the error handling won't
work.  In this code we are passing "1" as the minimum number of IRQs and
if it cannot allocate the minimum number of IRQs then the function
returns -ENOSPC.  This means that it cannot return 0 here.

Fix the signedness bug by using a "int ret;" and preserve the error
code instead of always returning -ENOSPC.

Fixes: d4d7a22521c9 ("RDMA/erdma: Add the erdma module")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Since this bug is found in the initial upstream patch of our new
driver, I would squash your changes into the relevant patch in our next
version patch set to make the commit history cleaner.

Thanks,
Cheng Xu



[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