mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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>
This commit is contained in:
parent
2c1ea6abde
commit
36cf3b1363
1 changed files with 1 additions and 3 deletions
|
@ -521,7 +521,7 @@ struct platform_device *platform_device_register_full(
|
||||||
|
|
||||||
pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
|
pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
goto err_alloc;
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
pdev->dev.parent = pdevinfo->parent;
|
pdev->dev.parent = pdevinfo->parent;
|
||||||
pdev->dev.fwnode = pdevinfo->fwnode;
|
pdev->dev.fwnode = pdevinfo->fwnode;
|
||||||
|
@ -568,8 +568,6 @@ struct platform_device *platform_device_register_full(
|
||||||
err:
|
err:
|
||||||
ACPI_COMPANION_SET(&pdev->dev, NULL);
|
ACPI_COMPANION_SET(&pdev->dev, NULL);
|
||||||
kfree(pdev->dev.dma_mask);
|
kfree(pdev->dev.dma_mask);
|
||||||
|
|
||||||
err_alloc:
|
|
||||||
platform_device_put(pdev);
|
platform_device_put(pdev);
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue