Skip to content

Commit

Permalink
thunderbolt: Remove superfluous check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bernat, Yehezkel authored and Greg Kroah-Hartman committed Aug 28, 2017
1 parent 0875957 commit 8fdd6ab
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8fdd6ab

Please sign in to comment.