diff mbox

pinctrl: fix a memleak when freeing maps

Message ID 1374536739-18966-1-git-send-email-linus.walleij@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Linus Walleij July 22, 2013, 11:45 p.m. UTC
We forgot to free the node itself when free:ing a map.

Reported-by: xulinuxkernel <xulinuxkernel@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stephen Warren July 23, 2013, 4:01 p.m. UTC | #1
On 07/22/2013 04:45 PM, Linus Walleij wrote:
> We forgot to free the node itself when free:ing a map.
> 
> Reported-by: xulinuxkernel <xulinuxkernel@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Stephen Warren <swarren@nvidia.com>

The full name in the reported-by doesn't look accurate, but I suppose
that isn't an s-o-b entry, so it's not a big deal.
diff mbox

Patch

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 5b272bf..2a00239 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1193,6 +1193,7 @@  void pinctrl_unregister_map(struct pinctrl_map const *map)
 	list_for_each_entry(maps_node, &pinctrl_maps, node) {
 		if (maps_node->maps == map) {
 			list_del(&maps_node->node);
+			kfree(maps_node);
 			mutex_unlock(&pinctrl_maps_mutex);
 			return;
 		}