caif: Allow cfpkt_extr_head to process empty message

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>
This commit is contained in:
sjur.brandeland@stericsson.com 2011-11-30 09:22:46 +00:00 committed by David S. Miller
parent 7bc0f28c7a
commit 200c5a3b38

View file

@ -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;
}