pinctrl: rza1: Handle devm_kasprintf() failure cases
commitabcfd9c3d93b105c8cae9d43d18ed5d9765611f2
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 7 Dec 2018 10:34:27 +0000 (7 11:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:22 +0000 (12 20:02 +0100)
tree6363115edc9263c3bcd5acc5125e548753febda7
parent5c4c55083953eea6649dc4c19606b5a77daa7030
pinctrl: rza1: Handle devm_kasprintf() failure cases

[ Upstream commit db221412cd2014506642967155698825ad80f6b6 ]

devm_kasprintf() may return NULL on failure of internal allocation
thus the assignments are not safe if not checked. On error
rza1_pinctrl_register() respectively rza1_parse_gpiochip() return
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: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-rza1.c