Skip to content

Commit

Permalink
driver core/platform_device_add_resources: free resource before overw…
Browse files Browse the repository at this point in the history
…riting

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>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Apr 23, 2011
1 parent cea8962 commit 4a03d6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a03d6f

Please sign in to comment.