Skip to content

Commit

Permalink
crypto: chcr - Fixes Unchecked dereference inside function
Browse files Browse the repository at this point in the history
Fixes 324429d, Unchecked dereference inside function.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jitendra Lulla <JLULLA@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Harsh Jain authored and Herbert Xu committed Nov 30, 2016
1 parent 358961d commit 18f0aa0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/crypto/chelsio/chcr_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ write_sg_to_skb(struct sk_buff *skb, unsigned int *frags,
skb->len += count;
skb->data_len += count;
skb->truesize += count;

while (count > 0) {
if (sg && (!(sg->length)))
if (!sg || (!(sg->length)))
break;
spage = sg_page(sg);
get_page(spage);
Expand Down

0 comments on commit 18f0aa0

Please sign in to comment.