]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: nuvoton: check for devm_kasprintf() failure
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 23 Nov 2018 16:12:58 +0000 (17:12 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 5 Dec 2018 21:55:04 +0000 (22:55 +0100)
commit8c8531dbcdb5f657c0bb1d622949a14620de8e55
tree21411ccdbfe15d4658db3498f2c892269905a1ce
parent3083836b60f3ec8b743696ea70e177f013366ffb
pinctrl: nuvoton: check for devm_kasprintf() failure

devm_kasprintf() may return NULL on failure of internal allocation thus
the assignment to  .label  is not safe if not checked. On error
npcm7xx_gpio_of() returns negative values so -ENOMEM in the
(unlikely) failure case of devm_kasprintf() should be fine here.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: 87f9633319f6 ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c