public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Harsh Jain <Harsh@chelsio.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jitendra Lulla <JLULLA@chelsio.com>,
	Atul Gupta <atul.gupta@chelsio.com>,
	Hariprasad Shenai <hariprasad@chelsio.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] crypto: chcr - checking for IS_ERR() instead of NULL
Date: Fri, 02 Dec 2016 06:11:44 +0000	[thread overview]
Message-ID: <d2933f1a-e15e-8c33-2905-3f8161b0db7d@chelsio.com> (raw)
In-Reply-To: <20161201204937.GA10701@mwanda>



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 <dan.carpenter@oracle.com>
>
> 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, &params);
> -
> -	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, &params);
> -	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, &params);
> -	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, &params);
> -	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);


  reply	other threads:[~2016-12-02  6:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 20:49 [patch] crypto: chcr - checking for IS_ERR() instead of NULL Dan Carpenter
2016-12-02  6:11 ` Harsh Jain [this message]
2016-12-02  6:24   ` Harsh Jain
2016-12-07 12:07 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2933f1a-e15e-8c33-2905-3f8161b0db7d@chelsio.com \
    --to=harsh@chelsio.com \
    --cc=JLULLA@chelsio.com \
    --cc=atul.gupta@chelsio.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=hariprasad@chelsio.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox