* [PATCH -next] RDMA/rtrs: server: fix some error return code
@ 2020-05-19 9:19 Wei Yongjun
2020-05-19 9:36 ` Danil Kipnis
2020-05-19 23:44 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2020-05-19 9:19 UTC (permalink / raw)
To: Danil Kipnis, Jack Wang, Doug Ledford, Jason Gunthorpe
Cc: Wei Yongjun, linux-rdma, kernel-janitors, Hulk Robot
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")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 +++++---
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 1 +
2 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
index ba8ab33b94a2..526433580b96 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
@@ -660,8 +660,8 @@ static int map_cont_bufs(struct rtrs_srv_sess *sess)
GFP_KERNEL, sess->s.dev->ib_dev,
DMA_TO_DEVICE, rtrs_srv_rdma_done);
if (!srv_mr->iu) {
- rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n",
- -ENOMEM);
+ err = -ENOMEM;
+ rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n", err);
goto free_iu;
}
}
@@ -2150,8 +2150,10 @@ static int __init rtrs_server_init(void)
goto out_chunk_pool;
}
rtrs_wq = alloc_workqueue("rtrs_server_wq", WQ_MEM_RECLAIM, 0);
- if (!rtrs_wq)
+ if (!rtrs_wq) {
+ err = -ENOMEM;
goto out_dev_class;
+ }
return 0;
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] RDMA/rtrs: server: fix some error return code
2020-05-19 9:19 [PATCH -next] RDMA/rtrs: server: fix some error return code Wei Yongjun
@ 2020-05-19 9:36 ` Danil Kipnis
2020-05-19 23:44 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Danil Kipnis @ 2020-05-19 9:36 UTC (permalink / raw)
To: Wei Yongjun
Cc: Jack Wang, Doug Ledford, Jason Gunthorpe, linux-rdma,
kernel-janitors, Hulk Robot
On Tue, May 19, 2020 at 11:16 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> 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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 +++++---
> drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 1 +
> 2 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> index ba8ab33b94a2..526433580b96 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> @@ -660,8 +660,8 @@ static int map_cont_bufs(struct rtrs_srv_sess *sess)
> GFP_KERNEL, sess->s.dev->ib_dev,
> DMA_TO_DEVICE, rtrs_srv_rdma_done);
> if (!srv_mr->iu) {
> - rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n",
> - -ENOMEM);
> + err = -ENOMEM;
> + rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n", err);
> goto free_iu;
> }
> }
> @@ -2150,8 +2150,10 @@ static int __init rtrs_server_init(void)
> goto out_chunk_pool;
> }
> rtrs_wq = alloc_workqueue("rtrs_server_wq", WQ_MEM_RECLAIM, 0);
> - if (!rtrs_wq)
> + if (!rtrs_wq) {
> + err = -ENOMEM;
> goto out_dev_class;
> + }
>
> return 0;
>
> 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;
>
Thanks a lot Wei!
Reviewed-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] RDMA/rtrs: server: fix some error return code
2020-05-19 9:19 [PATCH -next] RDMA/rtrs: server: fix some error return code Wei Yongjun
2020-05-19 9:36 ` Danil Kipnis
@ 2020-05-19 23:44 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-05-19 23:44 UTC (permalink / raw)
To: Wei Yongjun
Cc: Danil Kipnis, Jack Wang, Doug Ledford, linux-rdma,
kernel-janitors, Hulk Robot
On Tue, May 19, 2020 at 09:19:12AM +0000, Wei Yongjun wrote:
> 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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Reviewed-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> ---
> drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 +++++---
> drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 1 +
> 2 file changed, 6 insertions(+), 3 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-19 23:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 9:19 [PATCH -next] RDMA/rtrs: server: fix some error return code Wei Yongjun
2020-05-19 9:36 ` Danil Kipnis
2020-05-19 23:44 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).