mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 05:42:46 +01:00
ice, irdma: fix an off by one in error handling code
If we don't allocate the MIN number of IRQs then we need to free what
we have and return -ENOMEM. The problem is this loop is off by one
so it frees an entry that wasn't allocated and it doesn't free the
first entry where i == 0.
Fixes: 3e0d3cb3fb ("ice, irdma: move interrupts code to irdma")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Tatyana Nikolova <[email protected]>
Link: https://patch.msgid.link/[email protected]
Reviewed-by: Michal Swiatkowski <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
This commit is contained in:
1 parent
80f2ab46c2
commit
4bcc063939
1 file changed
+1
-1
@@ -221,7 +221,7 @@ static int irdma_init_interrupts(struct irdma_pci_f *rf, struct ice_pf *pf)
|
||||
break;
|
||||
|
||||
if (i < IRDMA_MIN_MSIX) {
|
||||
for (; i > 0; i--)
|
||||
while (--i >= 0)
|
||||
ice_free_rdma_qvector(pf, &rf->msix_entries[i]);
|
||||
|
||||
kfree(rf->msix_entries);
|
||||
|
||||
Reference in new issue
Block a user