]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:15 +0000 (20:02 +0100)
commitc10c3d86c5607a92d0c31ba9a58308668c203ba0
treed7c3bf0b441e4534651a360ffe24db458c2900f6
parenta8a93e11847bf5e100f5441d59e93e62b17d402c
pinctrl: nuvoton: check for devm_kasprintf() failure

[ Upstream commit 4be1eaf322f07bb9694618fd2763a3a1f0a3dd25 ]

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: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c