caif: added check for potential null return
authorKim Lilliestierna XX <kim.xx.lilliestierna@stericsson.com>
Mon, 25 Jun 2012 07:49:34 +0000 (07:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jun 2012 23:44:11 +0000 (16:44 -0700)
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>
net/caif/caif_dev.c

index e601da7ca2ff610905f74862a4bf7e2e15e319f5..551d2fd6a80ddf38bef9253a5a943113eb8390c8 100644 (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();