aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/caif_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/caif/caif_dev.c')
-rw-r--r--net/caif/caif_dev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 554b31289607..551d2fd6a80d 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -90,11 +90,8 @@ static int caifd_refcnt_read(struct caif_device_entry *e)
90/* Allocate new CAIF device. */ 90/* Allocate new CAIF device. */
91static struct caif_device_entry *caif_device_alloc(struct net_device *dev) 91static struct caif_device_entry *caif_device_alloc(struct net_device *dev)
92{ 92{
93 struct caif_device_entry_list *caifdevs;
94 struct caif_device_entry *caifd; 93 struct caif_device_entry *caifd;
95 94
96 caifdevs = caif_device_list(dev_net(dev));
97
98 caifd = kzalloc(sizeof(*caifd), GFP_KERNEL); 95 caifd = kzalloc(sizeof(*caifd), GFP_KERNEL);
99 if (!caifd) 96 if (!caifd)
100 return NULL; 97 return NULL;
@@ -131,6 +128,11 @@ void caif_flow_cb(struct sk_buff *skb)
131 128
132 rcu_read_lock(); 129 rcu_read_lock();
133 caifd = caif_get(skb->dev); 130 caifd = caif_get(skb->dev);
131
132 WARN_ON(caifd == NULL);
133 if (caifd == NULL)
134 return;
135
134 caifd_hold(caifd); 136 caifd_hold(caifd);
135 rcu_read_unlock(); 137 rcu_read_unlock();
136 138