i3c: fix an error code in i3c_master_add_i3c_dev_locked()

We should return "ret" as-is.  The "newdev" variable is a valid pointer.

Fixes: 3a379bbcea ("i3c: Add core I3C infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
Dan Carpenter 2018-11-23 10:14:42 +03:00 committed by Boris Brezillon
parent 2b2b283c05
commit 840414ae59

View File

@ -1823,10 +1823,8 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
return PTR_ERR(newdev);
ret = i3c_master_attach_i3c_dev(master, newdev);
if (ret) {
ret = PTR_ERR(newdev);
if (ret)
goto err_free_dev;
}
ret = i3c_master_retrieve_dev_info(newdev);
if (ret)