提交 251e031d 编写于 作者: U Uwe Kleine-König 提交者: Greg Kroah-Hartman

driver core/platform_device_add_data: free platform data before overwriting

Reviewed-by: NViresh Kumar <viresh.kumar@st.com>
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 27a33f9e
......@@ -228,6 +228,7 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,
return -ENOMEM;
}
kfree(pdev->dev.platform_data);
pdev->dev.platform_data = d;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册