mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
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>
This commit is contained in:
parent
cea896238f
commit
4a03d6f7c8
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue