caif: added check for potential null return

Add check on NULL return from caif_get().

Signed-off-by: Kim Lilliestierna <Kim.xx.Lilliestierna@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericssion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kim Lilliestierna XX 2012-06-25 07:49:34 +00:00 committed by David S. Miller
parent be4852c957
commit c95567c803

View file

@ -128,6 +128,11 @@ void caif_flow_cb(struct sk_buff *skb)
rcu_read_lock();
caifd = caif_get(skb->dev);
WARN_ON(caifd == NULL);
if (caifd == NULL)
return;
caifd_hold(caifd);
rcu_read_unlock();