diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-04-20 09:44:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-22 17:09:13 -0700 |
commit | 4a03d6f7c863a039b937649a93341615f531358e (patch) | |
tree | 70906acfe285ec87c8b037e61da5fc27dd21f78b | |
parent | cea896238fbfdbce254f51fc8fd78c59df50081f (diff) | |
download | op-kernel-dev-4a03d6f7c863a039b937649a93341615f531358e.zip op-kernel-dev-4a03d6f7c863a039b937649a93341615f531358e.tar.gz |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 667f282..7d4bdaf 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; |