Searched hist:f188ac1251b909c2d804a6fee54e4e360754c92f (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/gpio/ |
H A D | gpiolib-cdev.c | diff f188ac1251b909c2d804a6fee54e4e360754c92f Mon Oct 05 02:02:46 CDT 2020 Kent Gibson <warthog618@gmail.com> 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>
|