From: sjur.brandeland@stericsson.com Date: Wed, 30 Nov 2011 09:22:46 +0000 (+0000) Subject: caif: Allow cfpkt_extr_head to process empty message X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=200c5a3b387c415e49639ee0f6de37804522b745;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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; }