diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-04-20 09:44:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-22 17:09:12 -0700 |
commit | 251e031d132ea3d03e0a32f2240c67f449979c5d (patch) | |
tree | 83ee22c8d152196875959a58c3e5fb99544468e4 /drivers | |
parent | 27a33f9e8fb203e71925257cf039fe6ec623c5d1 (diff) | |
download | linux-stable-251e031d132ea3d03e0a32f2240c67f449979c5d.tar.gz linux-stable-251e031d132ea3d03e0a32f2240c67f449979c5d.tar.bz2 linux-stable-251e031d132ea3d03e0a32f2240c67f449979c5d.zip |
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')
-rw-r--r-- | drivers/base/platform.c | 1 |
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; } |