[PATCH 4.13 14/52] thunderbolt: Remove superfluous check

From: Greg Kroah-Hartman
Date: Mon Sep 18 2017 - 05:10:59 EST


4.13-stable review patch. If anyone has any objections, please let me know.

------------------

From: Bernat, Yehezkel <yehezkel.bernat@xxxxxxxxx>

commit 8fdd6ab36197ad891233572c57781b1f537da0ac upstream.

The key size is tested by hex2bin() already (as '\0' isn't an hex digit)

Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@xxxxxxxxx>
Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/thunderbolt/switch.c | 3 ---
1 file changed, 3 deletions(-)

--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -808,9 +808,6 @@ static ssize_t key_store(struct device *
u8 key[TB_SWITCH_KEY_SIZE];
ssize_t ret = count;

- if (count < 64)
- return -EINVAL;
-
if (hex2bin(key, buf, sizeof(key)))
return -EINVAL;