diff options
author | Bernat, Yehezkel <yehezkel.bernat@intel.com> | 2017-08-15 01:19:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-28 10:21:32 -0400 |
commit | 8fdd6ab36197ad891233572c57781b1f537da0ac (patch) | |
tree | b18a925fc91b53d49bf9e51953ab163b8178ed5e /drivers/thunderbolt | |
parent | 0875957e4bdd61d7969c47e29dab8769c9ab2cf9 (diff) |
thunderbolt: Remove superfluous check
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>
Diffstat (limited to 'drivers/thunderbolt')
-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, | |||
808 | u8 key[TB_SWITCH_KEY_SIZE]; | 808 | u8 key[TB_SWITCH_KEY_SIZE]; |
809 | ssize_t ret = count; | 809 | ssize_t ret = count; |
810 | 810 | ||
811 | if (count < 64) | ||
812 | return -EINVAL; | ||
813 | |||
814 | if (hex2bin(key, buf, sizeof(key))) | 811 | if (hex2bin(key, buf, sizeof(key))) |
815 | return -EINVAL; | 812 | return -EINVAL; |
816 | 813 | ||