]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
thunderbolt: Remove superfluous check
authorBernat, Yehezkel <yehezkel.bernat@intel.com>
Tue, 15 Aug 2017 05:19:01 +0000 (08:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:21:32 +0000 (16:21 +0200)
The key size is tested by hex2bin() already (as '\0' isn't an hex digit)

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/switch.c

index e9391bbd4036023c63d8b7ec90185f56f9523ade..69fde0b30eda86bd01591f9b18578312bb26c4c4 100644 (file)
@@ -808,9 +808,6 @@ static ssize_t key_store(struct device *dev, struct device_attribute *attr,
        u8 key[TB_SWITCH_KEY_SIZE];
        ssize_t ret = count;
 
-       if (count < 64)
-               return -EINVAL;
-
        if (hex2bin(key, buf, sizeof(key)))
                return -EINVAL;