[PATCH v11 02/11] scsi: ibmvfc: fix potential clobbering of rc after failed irq setup
From: Tyrel Datwyler
Date: Fri Sep 25 2026 - 00:49:50 EST
Fix a variable-shadowing bug in ibmvfc_register_channel() where the
irq_failed cleanup loop reused rc for the H_FREE_SUB_CRQ hcall result,
clobbering the error code returned to the caller.
Introduce hcall_rc for the cleanup loop instead.
Signed-off-by: Dave Marquardt <davemarq@xxxxxxxxxxxxx>
Signed-off-by: Tyrel Datwyler <tyreld@xxxxxxxxxxxxx>
---
drivers/scsi/ibmvscsi/ibmvfc-core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c
index c4dc48ef1ec8..17c49a0ed4f4 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc-core.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c
@@ -6392,6 +6392,7 @@ static int ibmvfc_register_channel(struct ibmvfc_host *vhost,
struct vio_dev *vdev = to_vio_dev(dev);
struct ibmvfc_queue *scrq = &channels->scrqs[index];
int rc = -ENOMEM;
+ int hcall_rc;
ENTER;
@@ -6447,8 +6448,8 @@ static int ibmvfc_register_channel(struct ibmvfc_host *vhost,
irq_failed:
do {
- rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie);
- } while (rc == H_BUSY || H_IS_LONG_BUSY(rc));
+ hcall_rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie);
+ } while (hcall_rc == H_BUSY || H_IS_LONG_BUSY(hcall_rc));
reg_failed:
LEAVE;
return rc;
--
2.55.0