diff mbox series

[5/6] scsi: pmcraid: fix missing resource cleanup in error case

Message ID 20220529153456.4183738-6-cgxu519@mykernel.net (mailing list archive)
State Accepted
Commit ec1e8adcbdf661c57c395bca342945f4f815add7
Headers show
Series fix a common error of while loop condition in error path | expand

Commit Message

Chengguang Xu May 29, 2022, 3:34 p.m. UTC
Fix missing resource cleanup(when '(--i) == 0') for error case in
pmcraid_register_interrupt_handler().

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
 drivers/scsi/pmcraid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 3d5cd337a2a6..0007a8a993a1 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4031,7 +4031,7 @@  pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
 	return 0;
 
 out_unwind:
-	while (--i > 0)
+	while (--i >= 0)
 		free_irq(pci_irq_vector(pdev, i), &pinstance->hrrq_vector[i]);
 	pci_free_irq_vectors(pdev);
 	return rc;