diff options
author | Kent Gibson <warthog618@gmail.com> | 2020-10-05 09:02:46 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-10-08 22:57:16 +0200 |
commit | f188ac1251b909c2d804a6fee54e4e360754c92f (patch) | |
tree | eacd83d158b0926a4bbfb47713af0dd7ec4e8be5 /drivers/gpio/gpiolib-cdev.h | |
parent | docs: gpio: add a new document to its index.rst (diff) | |
download | linux-f188ac1251b909c2d804a6fee54e4e360754c92f.tar.xz linux-f188ac1251b909c2d804a6fee54e4e360754c92f.zip |
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: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20201005070246.20927-1-warthog618@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-cdev.h')
0 files changed, 0 insertions, 0 deletions