summaryrefslogtreecommitdiff
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-03 15:33:20 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-07 21:48:16 -0400
commit80927822e8b6be46f488524cd7d5fe683de97fc4 (patch)
tree1887172b2ee6409ea65456b3583da2cd70216388 /drivers/scsi/device_handler
parent8b1afb7ab0dbbb8f9186e94ecded6660da1161ae (diff)
downloadlwn-80927822e8b6be46f488524cd7d5fe683de97fc4.tar.gz
lwn-80927822e8b6be46f488524cd7d5fe683de97fc4.zip
scsi: scsi_dh_alua: Fix signedness bug in alua_rtpg()
The "retval" variable needs to be signed for the error handling to work. Link: https://lore.kernel.org/r/YLjMEAFNxOas1mIp@mwanda Fixes: 7e26e3ea0287 ("scsi: scsi_dh_alua: Check for negative result value") Reviewed-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 7baee18ebd03..37d06f993b76 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -518,7 +518,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
int len, k, off, bufflen = ALUA_RTPG_SIZE;
int group_id_old, state_old, pref_old, valid_states_old;
unsigned char *desc, *buff;
- unsigned err, retval;
+ unsigned err;
+ int retval;
unsigned int tpg_desc_tbl_off;
unsigned char orig_transition_tmo;
unsigned long flags;