From: Uwe Kleine-König Date: Wed, 20 Apr 2011 07:44:43 +0000 (+0200) Subject: driver core/platform_device_add_data: free platform data before overwriting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=251e031d132ea3d03e0a32f2240c67f449979c5d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git driver core/platform_device_add_data: free platform data before overwriting Reviewed-by: Viresh Kumar Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 65cb4c397603..58ad8e8ad7a3 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -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; }