scsi: ipr: Fix missing/incorrect resource cleanup in error case
authorChengguang Xu <cgxu519@mykernel.net>
Sun, 29 May 2022 15:34:53 +0000 (23:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:21:57 +0000 (14:21 +0200)
commitd3b3950b00a19a0f7aa678e99162a03d6e0e7b47
tree6ba4edcbb35910f608dcab0a8deb42b11163fa4b
parentcb8aa5b92a319a0b08cf57e331cef0213b884263
scsi: ipr: Fix missing/incorrect resource cleanup in error case

[ Upstream commit d64c491911322af1dcada98e5b9ee0d87e8c8fee ]

Fix missing resource cleanup (when '(--i) == 0') for error case in
ipr_alloc_mem() and skip incorrect resource cleanup (when '(--i) == 0') for
error case in ipr_request_other_msi_irqs() because variable i started from
1.

Link: https://lore.kernel.org/r/20220529153456.4183738-4-cgxu519@mykernel.net
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/ipr.c