Merge branch 'fixes_for-3.6' into fixes
[cascardo/linux.git] / net / caif / caif_dev.c
index 8c83c17..1ae1d9c 100644 (file)
@@ -90,11 +90,8 @@ static int caifd_refcnt_read(struct caif_device_entry *e)
 /* Allocate new CAIF device. */
 static struct caif_device_entry *caif_device_alloc(struct net_device *dev)
 {
-       struct caif_device_entry_list *caifdevs;
        struct caif_device_entry *caifd;
 
-       caifdevs = caif_device_list(dev_net(dev));
-
        caifd = kzalloc(sizeof(*caifd), GFP_KERNEL);
        if (!caifd)
                return NULL;
@@ -131,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();