summaryrefslogtreecommitdiffstats
path: root/drivers/i3c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-11-23 10:14:42 +0300
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-12-05 17:22:58 +0100
commit840414ae59d8858bca0a704e7f9c910d661348d7 (patch)
treec0e6a80272ff60ce3c02cf3a3c181887f082ddf9 /drivers/i3c
parent2b2b283c059617e1be6b49872fd004b59c66594a (diff)
downloadlinux-840414ae59d8858bca0a704e7f9c910d661348d7.tar.gz
linux-840414ae59d8858bca0a704e7f9c910d661348d7.tar.bz2
linux-840414ae59d8858bca0a704e7f9c910d661348d7.zip
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: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 0ea7bb045fad..bda4b9613e53 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -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)