Skip to content

Commit ad64639

Browse files
JiangJiaslinusw
authored andcommitted
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: 3b588e4 ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver") Signed-off-by: Jiasheng Jiang <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 73f8ce7 commit ad64639

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,8 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
18841884
}
18851885

18861886
pctrl->gpio_bank[id].base = ioremap(res.start, resource_size(&res));
1887+
if (!pctrl->gpio_bank[id].base)
1888+
return -EINVAL;
18871889

18881890
ret = bgpio_init(&pctrl->gpio_bank[id].gc, dev, 4,
18891891
pctrl->gpio_bank[id].base + NPCM7XX_GP_N_DIN,

0 commit comments

Comments
 (0)