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
|
@ -200,6 +200,7 @@ int platform_device_add_resources(struct platform_device *pdev,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kfree(pdev->resource);
|
||||||
pdev->resource = r;
|
pdev->resource = r;
|
||||||
pdev->num_resources = num;
|
pdev->num_resources = num;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue