[PATCH] Fix accepting invalid block size

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

 



bshift can be negative so its type should not be unsigned or the
comparison of its negative never succeeds.

Signed-off-by: Roi Dayan <roid@xxxxxxxxxxxx>
---
 usr/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/target.c b/usr/target.c
index 6dce46b..f109f17 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -611,7 +611,7 @@ tgtadm_err tgt_device_create(int tid, int dev_type, uint64_t lun, char *params,
 	lu->blk_shift = 0;
 	if (blocksize) {
 		unsigned int bsize;
-		unsigned int bshift;
+		int bshift;
 
 		dprintf("blocksize=%s\n", blocksize);
 		bsize = strtoul(blocksize, NULL, 0);
-- 
1.8.4.3

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux