From: Bernat, Yehezkel Date: Tue, 15 Aug 2017 05:19:01 +0000 (+0300) Subject: thunderbolt: Remove superfluous check X-Git-Tag: v4.13.3~40 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b92e97e6e5d3ae7bf4472a59f9b40ee589e76ed2;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: Yehezkel Bernat Acked-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index e9391bbd40360..69fde0b30eda8 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;