summaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2019-03-01 13:24:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-01 18:08:06 +0100
commit36cf3b1363f464c40f6ce647d3ac0ae9617d5fbc (patch)
tree1de22749783d9a27511f50ae1d51e965ce6ade36 /drivers/base/platform.c
parent2c1ea6abde8884208a9b94254740ae4597c62000 (diff)
downloadlinux-36cf3b1363f464c40f6ce647d3ac0ae9617d5fbc.tar.bz2
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.c4
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(
pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
if (!pdev)
- goto err_alloc;
+ return ERR_PTR(-ENOMEM);
pdev->dev.parent = pdevinfo->parent;
pdev->dev.fwnode = pdevinfo->fwnode;
@@ -568,8 +568,6 @@ struct platform_device *platform_device_register_full(
err:
ACPI_COMPANION_SET(&pdev->dev, NULL);
kfree(pdev->dev.dma_mask);
-
-err_alloc:
platform_device_put(pdev);
return ERR_PTR(ret);
}