]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: atm: remove unnecessary code
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Thu, 16 Feb 2017 22:27:36 +0000 (16:27 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Mar 2017 08:58:44 +0000 (17:58 +0900)
'index' is an unsigned variable, and less-than-zero comparison of an unsigned
variable is never true.

Addresses-Coverity-ID: 115396
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/atm/cxacru.c

index f9fe86b6f7b5b6ac5e35d944500cd74781f6dd26..d65a64c29b852af9ec47f48fe4d3e0024aa66743 100644 (file)
@@ -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;