* [PATCH -next] IB/srp: Fix return value check in srp_init_module()
@ 2014-08-14 0:56 weiyj_lk-9Onoh4P/yGk
[not found] ` <1407977782-15194-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk-9Onoh4P/yGk @ 2014-08-14 0:56 UTC (permalink / raw)
To: Bart Van Assche, Roland Dreier, Sean Hefty, Hal Rosenstock
Cc: Wei Yongjun, linux-rdma-u79uwXL29TY76Z2rM5mHXA
From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
In case of error, the function create_workqueue() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
drivers/infiniband/ulp/srp/ib_srp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 7f5ee7f..62d2a18 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3320,8 +3320,8 @@ static int __init srp_init_module(void)
}
srp_remove_wq = create_workqueue("srp_remove");
- if (IS_ERR(srp_remove_wq)) {
- ret = PTR_ERR(srp_remove_wq);
+ if (!srp_remove_wq) {
+ ret = -ENOMEM;
goto out;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] IB/srp: Fix return value check in srp_init_module()
[not found] ` <1407977782-15194-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
@ 2014-08-14 14:57 ` Bart Van Assche
0 siblings, 0 replies; 2+ messages in thread
From: Bart Van Assche @ 2014-08-14 14:57 UTC (permalink / raw)
To: weiyj_lk-9Onoh4P/yGk, Roland Dreier, Sean Hefty, Hal Rosenstock
Cc: Wei Yongjun, linux-rdma-u79uwXL29TY76Z2rM5mHXA
On 08/14/14 02:56, weiyj_lk-9Onoh4P/yGk@public.gmane.org wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> In case of error, the function create_workqueue() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
> drivers/infiniband/ulp/srp/ib_srp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 7f5ee7f..62d2a18 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -3320,8 +3320,8 @@ static int __init srp_init_module(void)
> }
>
> srp_remove_wq = create_workqueue("srp_remove");
> - if (IS_ERR(srp_remove_wq)) {
> - ret = PTR_ERR(srp_remove_wq);
> + if (!srp_remove_wq) {
> + ret = -ENOMEM;
> goto out;
> }
Acked-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-14 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 0:56 [PATCH -next] IB/srp: Fix return value check in srp_init_module() weiyj_lk-9Onoh4P/yGk
[not found] ` <1407977782-15194-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
2014-08-14 14:57 ` Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox