From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [PATCH -next] IB/srp: Fix return value check in srp_init_module() Date: Thu, 14 Aug 2014 16:57:08 +0200 Message-ID: <53ECCE44.6090108@acm.org> References: <1407977782-15194-1-git-send-email-weiyj_lk@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1407977782-15194-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: weiyj_lk-9Onoh4P/yGk@public.gmane.org, Roland Dreier , Sean Hefty , Hal Rosenstock Cc: Wei Yongjun , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On 08/14/14 02:56, weiyj_lk-9Onoh4P/yGk@public.gmane.org wrote: > From: Wei Yongjun > > 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 > --- > 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 -- 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