summaryrefslogtreecommitdiff
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-04-20 09:44:45 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 17:09:13 -0700
commit4a03d6f7c863a039b937649a93341615f531358e (patch)
tree70906acfe285ec87c8b037e61da5fc27dd21f78b /drivers/base/platform.c
parentcea896238fbfdbce254f51fc8fd78c59df50081f (diff)
downloadlwn-4a03d6f7c863a039b937649a93341615f531358e.tar.gz
lwn-4a03d6f7c863a039b937649a93341615f531358e.zip
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>
Diffstat (limited to 'drivers/base/platform.c')
-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,
return -ENOMEM;
}
+ kfree(pdev->resource);
pdev->resource = r;
pdev->num_resources = num;
return 0;