summaryrefslogtreecommitdiffstats
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:43 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 17:09:12 -0700
commit251e031d132ea3d03e0a32f2240c67f449979c5d (patch)
tree83ee22c8d152196875959a58c3e5fb99544468e4 /drivers/base/platform.c
parent27a33f9e8fb203e71925257cf039fe6ec623c5d1 (diff)
downloadlinux-251e031d132ea3d03e0a32f2240c67f449979c5d.tar.bz2
driver core/platform_device_add_data: free platform data 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 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;
}