ARM: OMAP2+: Missing error code in omap_device_build()

We need to set the error code if omap_device_alloc() fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
Dan Carpenter 2017-11-14 09:06:48 +03:00 committed by Tony Lindgren
parent b6d6af7226
commit e9a9bb4e47
1 changed files with 3 additions and 1 deletions

View File

@ -516,8 +516,10 @@ struct platform_device __init *omap_device_build(const char *pdev_name,
goto odbs_exit1;
od = omap_device_alloc(pdev, &oh, 1);
if (IS_ERR(od))
if (IS_ERR(od)) {
ret = PTR_ERR(od);
goto odbs_exit1;
}
ret = platform_device_add_data(pdev, pdata, pdata_len);
if (ret)