crypto: chcr - checking for IS_ERR() instead of NULL
Subsystems (3)
PATCH 1/1 crypto: chcr - checking for IS_ERR() instead of NULL
The create_hash_wr() function never returns error pointers. It returns NULL on error.
Fixes 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr")
Signed-off-by Dan Carpenter <[email protected]>
drivers/crypto/chelsio/chcr_algo.c +8 -9
@@ -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);
Quoted 2 lines · Dan Carpenter
The
create_hash_wr()function never returns error pointers. It returns NULL on error.
Will fix the same, Thanks
Quoted 53 lines
Fixes 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr")Signed-off-by Dan Carpenter <[email protected]>drivers/crypto/chelsio/chcr_algo.c +8
-9@@ -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);
Quoted 5 lines · Harsh Jain
Quoted 2 lines · Dan Carpenter
The
create_hash_wr()function never returns error pointers. It returns NULL on error.Will fix the same, Thanks
It's a patch mail not bug reporting! Sorry for confusion. You have already fixed it. Thanks.
Quoted 52 lines
Quoted 52 lines
Fixes 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr")Signed-off-by Dan Carpenter <[email protected]>drivers/crypto/chelsio/chcr_algo.c +8
-9@@ -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);
Herbert Xu
maintainerQuoted 5 lines · Dan Carpenter
The
create_hash_wr()function never returns error pointers. It returns NULL on error.Fixes 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr")Signed-off-by Dan Carpenter <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt