From: Uwe Kleine-König Date: Wed, 20 Apr 2011 07:44:45 +0000 (+0200) Subject: driver core/platform_device_add_resources: free resource before overwriting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a03d6f7c863a039b937649a93341615f531358e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git driver core/platform_device_add_resources: free resource 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 667f282f8b7b..7d4bdaf557cf 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -200,6 +200,7 @@ int platform_device_add_resources(struct platform_device *pdev, return -ENOMEM; } + kfree(pdev->resource); pdev->resource = r; pdev->num_resources = num; return 0;