From: Harsh Jain Subject: Re: [patch] crypto: chcr - checking for IS_ERR() instead of NULL Date: Fri, 2 Dec 2016 11:29:44 +0530 Message-ID: References: <20161201204937.GA10701@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Jitendra Lulla , Atul Gupta , Hariprasad Shenai , Wei Yongjun , linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org To: Dan Carpenter , Herbert Xu Return-path: Received: from stargate.chelsio.com ([12.32.117.8]:37865 "EHLO l.chelsio.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757037AbcLBGyJ (ORCPT ); Fri, 2 Dec 2016 01:54:09 -0500 In-Reply-To: <20161201204937.GA10701@mwanda> Sender: linux-crypto-owner@vger.kernel.org List-ID: On 02-12-2016 02:19, Dan Carpenter wrote: > The create_hash_wr() function never returns error pointers. It returns > NULL on error. Will fix the same, Thanks > > Fixes: 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr") > Signed-off-by: Dan Carpenter > > diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c > index 32361dd..2ed1e24 100644 > --- a/drivers/crypto/chelsio/chcr_algo.c > +++ b/drivers/crypto/chelsio/chcr_algo.c > @@ -958,9 +958,8 @@ static int chcr_ahash_update(struct ahash_request *req) > req_ctx->result = 0; > req_ctx->data_len += params.sg_len + params.bfr_len; > skb = create_hash_wr(req, ¶ms); > - > - if (IS_ERR(skb)) > - return PTR_ERR(skb); > + if (!skb) > + return -ENOMEM; > > if (remainder) { > u8 *temp; > @@ -1023,8 +1022,8 @@ static int chcr_ahash_final(struct ahash_request *req) > params.more = 0; > } > skb = create_hash_wr(req, ¶ms); > - if (IS_ERR(skb)) > - return PTR_ERR(skb); > + if (!skb) > + return -ENOMEM; > > skb->dev = u_ctx->lldi.ports[0]; > set_wr_txq(skb, CPL_PRIORITY_DATA, ctx->tx_channel_id); > @@ -1074,8 +1073,8 @@ static int chcr_ahash_finup(struct ahash_request *req) > } > > skb = create_hash_wr(req, ¶ms); > - if (IS_ERR(skb)) > - return PTR_ERR(skb); > + if (!skb) > + return -ENOMEM; > > skb->dev = u_ctx->lldi.ports[0]; > set_wr_txq(skb, CPL_PRIORITY_DATA, ctx->tx_channel_id); > @@ -1125,8 +1124,8 @@ static int chcr_ahash_digest(struct ahash_request *req) > } > > skb = create_hash_wr(req, ¶ms); > - if (IS_ERR(skb)) > - return PTR_ERR(skb); > + if (!skb) > + return -ENOMEM; > > skb->dev = u_ctx->lldi.ports[0]; > set_wr_txq(skb, CPL_PRIORITY_DATA, ctx->tx_channel_id);