]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: scsi_dh_alua: Fix signedness bug in alua_rtpg()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 Jun 2021 12:33:20 +0000 (15:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:16:16 +0000 (16:16 +0200)
commit 80927822e8b6be46f488524cd7d5fe683de97fc4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/device_handler/scsi_dh_alua.c

index 41e8c9e6887830f49190d301c256a055ea940c60..4cf7c3348bffe10b538b199d26f9c8bcaee731ee 100644 (file)
@@ -522,7 +522,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
        struct alua_port_group *tmp_pg;
        int len, k, off, bufflen = ALUA_RTPG_SIZE;
        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;