pinctrl/lantiq: Free mapping configs for both pin and groups
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 14 May 2013 15:00:38 +0000 (17:00 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 15 May 2013 11:28:46 +0000 (13:28 +0200)
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 <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-lantiq.c

index 615c5002b757e1515187a1a87278a69d9a980d8f..d22ca252b80d41b6b1d10b59f83d9e33e9f9b1ef 100644 (file)
@@ -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);
 }