aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-01-06 20:05:19 -0500
committerMike Turquette <mturquette@linaro.org>2013-01-15 19:16:26 -0500
commitf1ba28a1f0fa16f3d0e78d199f3f9bf13e2d487b (patch)
tree1bf3d3566e11abf429bd1675dd0eee353db2a594 /drivers/clk
parente4eda8e0654c19cd7e3d143b051f3d5c213f0b43 (diff)
clk: max77686: Avoid double free at remove time
The clk_lookup entry is dropped at remove time by a call to clkdev_drop(). That function frees the entry, which is also freed by the driver core as it has been allocated through devm_kzalloc(). This results in a double free. Use kzalloc() instead of devm_kzalloc() to fix this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-max77686.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index 90bf59cf9d25..9f57bc37cd60 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -116,8 +116,7 @@ static int max77686_clk_register(struct device *dev,
116 if (IS_ERR(clk)) 116 if (IS_ERR(clk))
117 return -ENOMEM; 117 return -ENOMEM;
118 118
119 max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup), 119 max77686->lookup = kzalloc(sizeof(struct clk_lookup), GFP_KERNEL);
120 GFP_KERNEL);
121 if (!max77686->lookup) 120 if (!max77686->lookup)
122 return -ENOMEM; 121 return -ENOMEM;
123 122