提交 6b6cf2b5 编写于 作者: D Dmitry Osipenko 提交者: Lee Jones

mfd: core: Fix double-free in mfd_remove_devices_fn()

The pdev.mfd_cell is released by platform_device_release(), which is
invoked by platform_device_unregister(). Hence mfd_remove_devices_fn()
shouldn't release the cell variable. The double-free bug is reported KASAN
during of MFD driver module removal.

Fixes: 466a62d7 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 9123e3a7
......@@ -370,8 +370,6 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
cell->num_parent_supplies);
kfree(cell);
platform_device_unregister(pdev);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册