diff options
author | Johannes Berg <johannes.berg@intel.com> | 2019-03-01 07:24:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-01 12:08:06 -0500 |
commit | 36cf3b1363f464c40f6ce647d3ac0ae9617d5fbc (patch) | |
tree | 1de22749783d9a27511f50ae1d51e965ce6ade36 /drivers/base/platform.c | |
parent | 2c1ea6abde8884208a9b94254740ae4597c62000 (diff) |
driver core: platform: remove misleading err_alloc label
In platform_device_register_full() the err_alloc label is
misleading, we only ever jump to it if the pdev is NULL,
but it then proceeds to free it, which is a no-op.
Remove the label and simply exit the function immediately.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 | } |