Commit 18f0aa06 authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu

crypto: chcr - Fixes Unchecked dereference inside function

Fixes 324429d7, Unchecked dereference inside function.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJitendra Lulla <JLULLA@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 358961d1
...@@ -439,8 +439,9 @@ write_sg_to_skb(struct sk_buff *skb, unsigned int *frags, ...@@ -439,8 +439,9 @@ write_sg_to_skb(struct sk_buff *skb, unsigned int *frags,
skb->len += count; skb->len += count;
skb->data_len += count; skb->data_len += count;
skb->truesize += count; skb->truesize += count;
while (count > 0) { while (count > 0) {
if (sg && (!(sg->length))) if (!sg || (!(sg->length)))
break; break;
spage = sg_page(sg); spage = sg_page(sg);
get_page(spage); get_page(spage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment