Commit 251e031d authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

driver core/platform_device_add_data: free platform data before overwriting

Reviewed-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 27a33f9e
...@@ -228,6 +228,7 @@ int platform_device_add_data(struct platform_device *pdev, const void *data, ...@@ -228,6 +228,7 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,
return -ENOMEM; return -ENOMEM;
} }
kfree(pdev->dev.platform_data);
pdev->dev.platform_data = d; pdev->dev.platform_data = d;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment