From 200c5a3b387c415e49639ee0f6de37804522b745 Mon Sep 17 00:00:00 2001 From: "sjur.brandeland@stericsson.com" Date: Wed, 30 Nov 2011 09:22:46 +0000 Subject: [PATCH] caif: Allow cfpkt_extr_head to process empty message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Allow NULL pointer in cfpkt_extr_head in order to skip past header data. Signed-off-by: Sjur Brændeland Signed-off-by: David S. Miller --- net/caif/cfpkt_skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c index df08c47183d4..de5390700cfe 100644 --- a/net/caif/cfpkt_skbuff.c +++ b/net/caif/cfpkt_skbuff.c @@ -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; } -- 2.20.1