Commit 3e61dfd8 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

Driver core: use kmemdup in platform_device_add_resources

This makes platform_device_add_resources look like
platform_device_add_data.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f8a4bd34
......@@ -191,13 +191,13 @@ int platform_device_add_resources(struct platform_device *pdev,
{
struct resource *r;
r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
if (r) {
memcpy(r, res, sizeof(struct resource) * num);
pdev->resource = r;
pdev->num_resources = num;
return 0;
}
return r ? 0 : -ENOMEM;
return -ENOMEM;
}
EXPORT_SYMBOL_GPL(platform_device_add_resources);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment