diff options
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 6b7953da4228..0eb51e33cb1b 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; } |