Skip to contentSkip to conversation

usb: atm: remove unnecessary code

PATCH New Gustavo A. R. Silva 1 participant 1 message Feb 16, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: atm: remove unnecessary code

'index' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true.

Addresses-Coverity-ID: 115396

---
 drivers/usb/atm/cxacru.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/atm/cxacru.c +1 -1
index f9fe86b6..d65a64c 100644
@@ -474,7 +474,7 @@ static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev,
 		ret = sscanf(buf + pos, "%x=%x%n", &index, &value, &tmp);
 		if (ret < 2)
 			return -EINVAL;
-		if (index < 0 || index > 0x7f)
+		if (index > 0x7f)
 			return -EINVAL;
 		if (tmp < 0 || tmp > len - pos)
 			return -EINVAL;
Signature · 1 line
2.5.0