spin_lock(&net->can.rcvlists_lock);
dev_rcv_lists = can_dev_rcv_lists_find(net, dev);
- if (dev_rcv_lists) {
- rcv_list = can_rcv_list_find(&can_id, &mask, dev_rcv_lists);
-
- rcv->can_id = can_id;
- rcv->mask = mask;
- rcv->matches = 0;
- rcv->func = func;
- rcv->data = data;
- rcv->ident = ident;
- rcv->sk = sk;
-
- hlist_add_head_rcu(&rcv->list, rcv_list);
- dev_rcv_lists->entries++;
-
- rcv_lists_stats->rcv_entries++;
- rcv_lists_stats->rcv_entries_max = max(rcv_lists_stats->rcv_entries_max,
- rcv_lists_stats->rcv_entries);
- } else {
- kmem_cache_free(rcv_cache, rcv);
- err = -ENODEV;
- }
+ rcv_list = can_rcv_list_find(&can_id, &mask, dev_rcv_lists);
+
+ rcv->can_id = can_id;
+ rcv->mask = mask;
+ rcv->matches = 0;
+ rcv->func = func;
+ rcv->data = data;
+ rcv->ident = ident;
+ rcv->sk = sk;
+ hlist_add_head_rcu(&rcv->list, rcv_list);
+ dev_rcv_lists->entries++;
+
+ rcv_lists_stats->rcv_entries++;
+ rcv_lists_stats->rcv_entries_max = max(rcv_lists_stats->rcv_entries_max,
+ rcv_lists_stats->rcv_entries);
spin_unlock(&net->can.rcvlists_lock);
return err;
spin_lock(&net->can.rcvlists_lock);
dev_rcv_lists = can_dev_rcv_lists_find(net, dev);
- if (!dev_rcv_lists) {
- pr_err("BUG: receive list not found for dev %s, id %03X, mask %03X\n",
- DNAME(dev), can_id, mask);
- goto out;
- }
-
rcv_list = can_rcv_list_find(&can_id, &mask, dev_rcv_lists);
/* Search the receiver list for the item to delete. This should
/* find receive list for this device */
dev_rcv_lists = can_dev_rcv_lists_find(net, dev);
- if (dev_rcv_lists)
- matches += can_rcv_filter(dev_rcv_lists, skb);
+ matches += can_rcv_filter(dev_rcv_lists, skb);
rcu_read_unlock();