Commit 840414ae authored by Dan Carpenter's avatar Dan Carpenter Committed by Boris Brezillon

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: 3a379bbc ("i3c: Add core I3C infrastructure")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent 2b2b283c
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment