libmultipath(coverity): fix int overflow in sysfs_set_scsi_tmo
authorMartin Wilck <mwilck@suse.com>
Tue, 8 Jan 2019 22:54:04 +0000 (23:54 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 19 Jan 2019 10:41:42 +0000 (11:41 +0100)
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c

index 3fd79a3..1748eeb 100644 (file)
@@ -711,7 +711,7 @@ sysfs_set_scsi_tmo (struct multipath *mpp, int checkint)
        int dev_loss_tmo = mpp->dev_loss;
 
        if (mpp->no_path_retry > 0) {
-               uint64_t no_path_retry_tmo = mpp->no_path_retry * checkint;
+               uint64_t no_path_retry_tmo = (uint64_t)mpp->no_path_retry * checkint;
 
                if (no_path_retry_tmo > MAX_DEV_LOSS_TMO)
                        no_path_retry_tmo = MAX_DEV_LOSS_TMO;