提交 36cf3b13 编写于 作者: J Johannes Berg 提交者: Greg Kroah-Hartman

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: NJohannes Berg <johannes.berg@intel.com>
Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2c1ea6ab
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册