Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: npcm7xx: Add missing check for ioremap

Add check for ioremap() and return the error if it fails in order to
guarantee the success of ioremap().

Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230607095829.1345-1-jiasheng@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jiasheng Jiang and committed by
Linus Walleij
ad646394 73f8ce7f

+2
+2
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
··· 1884 1884 } 1885 1885 1886 1886 pctrl->gpio_bank[id].base = ioremap(res.start, resource_size(&res)); 1887 + if (!pctrl->gpio_bank[id].base) 1888 + return -EINVAL; 1887 1889 1888 1890 ret = bgpio_init(&pctrl->gpio_bank[id].gc, dev, 4, 1889 1891 pctrl->gpio_bank[id].base + NPCM7XX_GP_N_DIN,