diff options
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index fc67a325beaa..4e45ac21d672 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -521,7 +521,7 @@ struct platform_device *platform_device_register_full( | |||
521 | 521 | ||
522 | pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id); | 522 | pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id); |
523 | if (!pdev) | 523 | if (!pdev) |
524 | goto err_alloc; | 524 | return ERR_PTR(-ENOMEM); |
525 | 525 | ||
526 | pdev->dev.parent = pdevinfo->parent; | 526 | pdev->dev.parent = pdevinfo->parent; |
527 | pdev->dev.fwnode = pdevinfo->fwnode; | 527 | pdev->dev.fwnode = pdevinfo->fwnode; |
@@ -568,8 +568,6 @@ struct platform_device *platform_device_register_full( | |||
568 | err: | 568 | err: |
569 | ACPI_COMPANION_SET(&pdev->dev, NULL); | 569 | ACPI_COMPANION_SET(&pdev->dev, NULL); |
570 | kfree(pdev->dev.dma_mask); | 570 | kfree(pdev->dev.dma_mask); |
571 | |||
572 | err_alloc: | ||
573 | platform_device_put(pdev); | 571 | platform_device_put(pdev); |
574 | return ERR_PTR(ret); | 572 | return ERR_PTR(ret); |
575 | } | 573 | } |