When creating mappings from DT both pin config and group config mappings
are allocated. Free them both when destroying the mappings.
Signed-off-by: Laurent Pinchart <[email protected]>
---
drivers/pinctrl/pinctrl-lantiq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-lantiq.c b/drivers/pinctrl/pinctrl-lantiq.c
index 615c500..d22ca25 100644
--- a/drivers/pinctrl/pinctrl-lantiq.c
+++ b/drivers/pinctrl/pinctrl-lantiq.c
@@ -52,7 +52,8 @@ static void ltq_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
int i;
for (i = 0; i < num_maps; i++)
- if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
+ if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN ||
+ map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
kfree(map[i].data.configs.configs);
kfree(map);
}
--
Regards,
Laurent Pinchart
On 14/05/13 17:00, Laurent Pinchart wrote:
> When creating mappings from DT both pin config and group config mappings
> are allocated. Free them both when destroying the mappings.
>
> Signed-off-by: Laurent Pinchart<[email protected]>
Acked-by: John Crispin <[email protected]>
> ---
> drivers/pinctrl/pinctrl-lantiq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-lantiq.c b/drivers/pinctrl/pinctrl-lantiq.c
> index 615c500..d22ca25 100644
> --- a/drivers/pinctrl/pinctrl-lantiq.c
> +++ b/drivers/pinctrl/pinctrl-lantiq.c
> @@ -52,7 +52,8 @@ static void ltq_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
> int i;
>
> for (i = 0; i< num_maps; i++)
> - if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
> + if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN ||
> + map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
> kfree(map[i].data.configs.configs);
> kfree(map);
> }
On Tue, May 14, 2013 at 5:00 PM, Laurent Pinchart
<[email protected]> wrote:
> When creating mappings from DT both pin config and group config mappings
> are allocated. Free them both when destroying the mappings.
>
> Signed-off-by: Laurent Pinchart <[email protected]>
Applied to fixes with John's ACK, thanks!
Yours,
Linus Walleij