diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 6b7953da4228f12471051c2502e59c270599b3e6..0eb51e33cb1be5412ab11d10e7cdb474a2faa061 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -398,13 +398,14 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, * map array */ *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL); - if (!map) + if (!*map) return -ENOMEM; return 0; err_free_map: - kfree(map); + kfree(*map); + *map = NULL; return ret; }