caif: Do not dereference NULL in chnl_recv_cb()
authorJesper Juhl <jj@chaosbits.net>
Fri, 17 Aug 2012 10:33:12 +0000 (10:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Aug 2012 09:47:49 +0000 (02:47 -0700)
commitd92c7f8aabae913de16eb855b19cd2002c341896
treedea18b0f4fb3e83a6ed87a8a1e23eb0cbb17aa0e
parent6c71bec66ae65305ba5c33c93aa722f21f092737
caif: Do not dereference NULL in chnl_recv_cb()

In net/caif/chnl_net.c::chnl_recv_cb() we call skb_header_pointer()
which may return NULL, but we do not check for a NULL pointer before
dereferencing it.
This patch adds such a NULL check and properly free's allocated memory
and return an error (-EINVAL) on failure - much better than crashing..

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/caif/chnl_net.c