diff options
author | Bernat, Yehezkel <yehezkel.bernat@intel.com> | 2017-08-15 08:19:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-20 08:27:47 +0200 |
commit | b92e97e6e5d3ae7bf4472a59f9b40ee589e76ed2 (patch) | |
tree | b96784f0c4d0a28c86634f7e0e0b6e6713ba765a | |
parent | 214d7f6b7e5ff16f2a694ed9d1627650c50bdacb (diff) | |
download | linux-b92e97e6e5d3ae7bf4472a59f9b40ee589e76ed2.tar.gz |
thunderbolt: Remove superfluous check
commit 8fdd6ab36197ad891233572c57781b1f537da0ac upstream.
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>
-rw-r--r-- | drivers/thunderbolt/switch.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index e9391bbd4036..69fde0b30eda 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -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; |