summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-05-19 11:19:12 +0200
committerJason Gunthorpe <jgg@mellanox.com>2020-05-20 01:42:25 +0200
commit6b31afcef51e578e936e66c347ab333c024963da (patch)
tree7c1938fe72768437d659634713c3c031cec5396b /drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
parentRDMA/rtrs: client: Fix function return on success (diff)
downloadlinux-6b31afcef51e578e936e66c347ab333c024963da.tar.xz
linux-6b31afcef51e578e936e66c347ab333c024963da.zip
RDMA/rtrs: server: Fix some error return code
Fix to return negative error code -ENOMEM from the some error handling cases instead of 0, as done elsewhere in this function. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Fixes: 91b11610af8d ("RDMA/rtrs: server: sysfs interface functions") Link: https://lore.kernel.org/r/20200519091912.134358-1-weiyongjun1@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Danil Kipnis <danil.kipnis@cloud.ionos.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c')
-rw-r--r--drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
index 0cf015634338..3d7877534bcc 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
@@ -189,6 +189,7 @@ static int rtrs_srv_create_once_sysfs_root_folders(struct rtrs_srv_sess *sess)
}
srv->kobj_paths = kobject_create_and_add("paths", &srv->dev.kobj);
if (!srv->kobj_paths) {
+ err = -ENOMEM;
pr_err("kobject_create_and_add(): %d\n", err);
device_unregister(&srv->dev);
goto unlock;