Skip to content
Commit f188ac12 authored by Kent Gibson's avatar Kent Gibson Committed by Linus Walleij
Browse files

gpiolib: cdev: switch from kstrdup() to kstrndup()



Use kstrndup() to copy line labels from the userspace provided char
array, rather than ensuring the char array contains a null terminator
and using kstrdup().

Note that the length provided to kstrndup() still assumes that the char
array does contain a null terminator, so the maximum string length is one
less than the array.  This is consistent with the previous behaviour.

Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20201005070246.20927-1-warthog618@gmail.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8c270fbc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment