diff options
-rw-r--r-- | net/can/af_can.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c index dc8f9720d5cd..e3b37676cf53 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -209,8 +209,9 @@ int can_send(struct sk_buff *skb, int loop) | |||
209 | skb->protocol = htons(ETH_P_CANFD); | 209 | skb->protocol = htons(ETH_P_CANFD); |
210 | if (unlikely(cfd->len > CANFD_MAX_DLEN)) | 210 | if (unlikely(cfd->len > CANFD_MAX_DLEN)) |
211 | goto inval_skb; | 211 | goto inval_skb; |
212 | } else | 212 | } else { |
213 | goto inval_skb; | 213 | goto inval_skb; |
214 | } | ||
214 | 215 | ||
215 | /* Make sure the CAN frame can pass the selected CAN netdevice. | 216 | /* Make sure the CAN frame can pass the selected CAN netdevice. |
216 | * As structs can_frame and canfd_frame are similar, we can provide | 217 | * As structs can_frame and canfd_frame are similar, we can provide |
@@ -753,8 +754,9 @@ int can_proto_register(const struct can_proto *cp) | |||
753 | if (rcu_access_pointer(proto_tab[proto])) { | 754 | if (rcu_access_pointer(proto_tab[proto])) { |
754 | pr_err("can: protocol %d already registered\n", proto); | 755 | pr_err("can: protocol %d already registered\n", proto); |
755 | err = -EBUSY; | 756 | err = -EBUSY; |
756 | } else | 757 | } else { |
757 | RCU_INIT_POINTER(proto_tab[proto], cp); | 758 | RCU_INIT_POINTER(proto_tab[proto], cp); |
759 | } | ||
758 | 760 | ||
759 | mutex_unlock(&proto_tab_lock); | 761 | mutex_unlock(&proto_tab_lock); |
760 | 762 | ||
@@ -812,15 +814,16 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg, | |||
812 | 814 | ||
813 | d = dev->ml_priv; | 815 | d = dev->ml_priv; |
814 | if (d) { | 816 | if (d) { |
815 | if (d->entries) | 817 | if (d->entries) { |
816 | d->remove_on_zero_entries = 1; | 818 | d->remove_on_zero_entries = 1; |
817 | else { | 819 | } else { |
818 | kfree(d); | 820 | kfree(d); |
819 | dev->ml_priv = NULL; | 821 | dev->ml_priv = NULL; |
820 | } | 822 | } |
821 | } else | 823 | } else { |
822 | pr_err("can: notifier: receive list not found for dev " | 824 | pr_err("can: notifier: receive list not found for dev " |
823 | "%s\n", dev->name); | 825 | "%s\n", dev->name); |
826 | } | ||
824 | 827 | ||
825 | spin_unlock(&dev_net(dev)->can.can_rcvlists_lock); | 828 | spin_unlock(&dev_net(dev)->can.can_rcvlists_lock); |
826 | 829 | ||