tun: Don't assume type tun in tun_device_event
[cascardo/linux.git] / drivers / net / tun.c
index 5eadb7a..9c8b5bc 100644 (file)
@@ -2503,6 +2503,9 @@ static int tun_device_event(struct notifier_block *unused,
        struct net_device *dev = netdev_notifier_info_to_dev(ptr);
        struct tun_struct *tun = netdev_priv(dev);
 
+       if (dev->rtnl_link_ops != &tun_link_ops)
+               return NOTIFY_DONE;
+
        switch (event) {
        case NETDEV_CHANGE_TX_QUEUE_LEN:
                if (tun_queue_resize(tun))