crypto: chelsio - Fix passing zero to 'PTR_ERR' warning in chcr_aead_op
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Jan 2019 06:55:17 +0000 (14:55 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Feb 2019 06:42:04 +0000 (14:42 +0800)
Fix a static code checker warning:
drivers/crypto/chelsio/chcr_algo.c:3681
 chcr_aead_op() warn: passing zero to 'PTR_ERR'

Fixes: 2debd3325e55 ("crypto: chcr - Add AEAD algos.")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/chelsio/chcr_algo.c

index adc1b3069d6011419c5979a69be17763e322ce7e..8d8cf80b929405b939b0fd4832bd4194e08317df 100644 (file)
@@ -3676,9 +3676,9 @@ static int chcr_aead_op(struct aead_request *req,
        /* Form a WR from req */
        skb = create_wr_fn(req, u_ctx->lldi.rxq_ids[a_ctx(tfm)->rx_qidx], size);
 
-       if (IS_ERR(skb) || !skb) {
+       if (IS_ERR_OR_NULL(skb)) {
                chcr_dec_wrcount(cdev);
-               return PTR_ERR(skb);
+               return PTR_ERR_OR_ZERO(skb);
        }
 
        skb->dev = u_ctx->lldi.ports[0];