aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-04-20 03:44:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 20:09:13 -0400
commit4a03d6f7c863a039b937649a93341615f531358e (patch)
tree70906acfe285ec87c8b037e61da5fc27dd21f78b
parentcea896238fbfdbce254f51fc8fd78c59df50081f (diff)
driver core/platform_device_add_resources: free resource before overwriting
Reviewed-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/base/platform.c1
1 files changed, 1 insertions, 0 deletions
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,
200 return -ENOMEM; 200 return -ENOMEM;
201 } 201 }
202 202
203 kfree(pdev->resource);
203 pdev->resource = r; 204 pdev->resource = r;
204 pdev->num_resources = num; 205 pdev->num_resources = num;
205 return 0; 206 return 0;