Skip to content

Commit

Permalink
caif: Allow cfpkt_extr_head to process empty message
Browse files Browse the repository at this point in the history
Allow NULL pointer in cfpkt_extr_head in order to
skip past header data.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
sjur.brandeland@stericsson.com authored and David S. Miller committed Dec 1, 2011
1 parent 7bc0f28 commit 200c5a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/caif/cfpkt_skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len)
}
from = skb_pull(skb, len);
from -= len;
memcpy(data, from, len);
if (data)
memcpy(data, from, len);
return 0;
}

Expand Down

0 comments on commit 200c5a3

Please sign in to comment.