[PATCH 39/39] libmultipath/discovery.c: Fixup possible range overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When checking the maximum value for dev_loss_tmo we need to
use a larger type, otherwise the comparison will always be false.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
 libmultipath/discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 5d5441d..126a54f 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -670,7 +670,7 @@ sysfs_set_scsi_tmo (struct multipath *mpp)
 	int dev_loss_tmo = mpp->dev_loss;
 
 	if (mpp->no_path_retry > 0) {
-		int no_path_retry_tmo = mpp->no_path_retry * conf->checkint;
+		uint64_t no_path_retry_tmo = mpp->no_path_retry * conf->checkint;
 
 		if (no_path_retry_tmo > MAX_DEV_LOSS_TMO)
 			no_path_retry_tmo = MAX_DEV_LOSS_TMO;
-- 
2.6.6

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux