net: pass info struct via netdevice notifier
[firefly-linux-kernel-4.4.55.git] / net / ax25 / af_ax25.c
index 7b11f8bc5071cba0de51054913fa5f3e8bb3f063..4b4d2b779ec1a08202303863fea1b74c67f04383 100644 (file)
@@ -111,9 +111,9 @@ again:
  *     Handle device status changes.
  */
 static int ax25_device_event(struct notifier_block *this, unsigned long event,
-       void *ptr)
+                            void *ptr)
 {
-       struct net_device *dev = (struct net_device *)ptr;
+       struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 
        if (!net_eq(dev_net(dev), &init_net))
                return NOTIFY_DONE;
@@ -1642,6 +1642,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
                ax25_address src;
                const unsigned char *mac = skb_mac_header(skb);
 
+               memset(sax, 0, sizeof(struct full_sockaddr_ax25));
                ax25_addr_parse(mac + 1, skb->data - mac - 1, &src, NULL,
                                &digi, NULL, NULL);
                sax->sax25_family = AF_AX25;
@@ -1973,7 +1974,7 @@ static struct packet_type ax25_packet_type __read_mostly = {
 };
 
 static struct notifier_block ax25_dev_notifier = {
-       .notifier_call =ax25_device_event,
+       .notifier_call = ax25_device_event,
 };
 
 static int __init ax25_init(void)