summaryrefslogtreecommitdiff
path: root/drivers/scsi/qedi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-09 12:27:14 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-09 23:01:24 -0400
commit2938bedd0efa0964db563999b9b3b866b2d1a090 (patch)
tree4fcbb62a0714d2ead7ddbdc50e168cede444bf2b /drivers/scsi/qedi
parentd46bdecd9f3cdf6c5e1beb5975b5dbf098c1a9f7 (diff)
scsi: mpi3mr: Fix error handling in mpi3mr_setup_isr()
The pci_alloc_irq_vectors_affinity() function returns negative error codes or it returns a number between the minimum vectors (1 in this case) and max_vectors. It won't return zero. Because "i" is a u16 then the error handling won't work. And also if it did work the error code was not set. Really "max_vectors" can be an int as well because we're doing a min_t() on int type. The other change is that it's better to remove unnecessary initialization so that static checkers can warn us if there are ever uninitialized variable bugs introduced in the future. I changed the error code from -1 (-EPERM) if the kmalloc() failed to -ENOMEM. And on success path I changed it from "return retval;" to "return 0;" which shouldn't affect the compiled code but makes it more readable. Link: https://lore.kernel.org/r/YMCJcnmSI4kOIyv/@mwanda Fixes: 824a156633df ("scsi: mpi3mr: Base driver code") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedi')
0 files changed, 0 insertions, 0 deletions