Skip to content

Commit

Permalink
Driver core: use kmemdup in platform_device_add_resources
Browse files Browse the repository at this point in the history
This makes platform_device_add_resources look like
platform_device_add_data.

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 Aug 5, 2010
1 parent f8a4bd3 commit 3e61dfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3e61dfd

Please sign in to comment.