]> git.hungrycats.org Git - linux/commit
pinctrl: at91-pio4: check return value of devm_kasprintf()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 15 Jun 2023 10:53:33 +0000 (13:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:48 +0000 (19:39 +0200)
commit5bfd577cc728270d6cd7af6c652a1e7661f25487
tree83fc78c0111d9db08ecf639481a5fcc5d4bd3e3d
parent4c7dcd17bce3e102e2e22cfe4090cc2388323962
pinctrl: at91-pio4: check return value of devm_kasprintf()

[ Upstream commit f6fd5d4ff8ca0b24cee1af4130bcb1fa96b61aa0 ]

devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller")
Depends-on: 1c4e5c470a56 ("pinctrl: at91: use devm_kasprintf() to avoid potential leaks")
Depends-on: 5a8f9cf269e8 ("pinctrl: at91-pio4: use proper format specifier for unsigned int")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230615105333.585304-4-claudiu.beznea@microchip.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-at91-pio4.c