Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213456
b: refs/heads/master
c: 5cfc64c
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 079bfbe commit 1015598
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87544653abe4a03324bc85dae32d5bdaabcfccef
refs/heads/master: 5cfc64ceb6222aabec640ba76e89529a8fc2c1f0
9 changes: 8 additions & 1 deletion trunk/drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ int platform_device_add_resources(struct platform_device *pdev,
{
struct resource *r;

if (!res)
return 0;

r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
if (r) {
pdev->resource = r;
Expand All @@ -215,8 +218,12 @@ EXPORT_SYMBOL_GPL(platform_device_add_resources);
int platform_device_add_data(struct platform_device *pdev, const void *data,
size_t size)
{
void *d = kmemdup(data, size, GFP_KERNEL);
void *d;

if (!data)
return 0;

d = kmemdup(data, size, GFP_KERNEL);
if (d) {
pdev->dev.platform_data = d;
return 0;
Expand Down

0 comments on commit 1015598

Please sign in to comment.