提交 f1ba28a1 编写于 作者: L Laurent Pinchart 提交者: Mike Turquette

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: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMike Turquette <mturquette@linaro.org>
上级 e4eda8e0
......@@ -116,8 +116,7 @@ static int max77686_clk_register(struct device *dev,
if (IS_ERR(clk))
return -ENOMEM;
max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
GFP_KERNEL);
max77686->lookup = kzalloc(sizeof(struct clk_lookup), GFP_KERNEL);
if (!max77686->lookup)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册