diff options
author | chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil> | 2009-12-04 00:19:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-08 23:22:30 -0500 |
commit | eb0445887a45a3705522aac6c2d8367e90358792 (patch) | |
tree | 12b489c8b9a1092fafa558c0496ef2ef1c3f7b6c /net/atm/lec.c | |
parent | 2a8875e73ffb18165ceb245f99c2ccad77378051 (diff) |
atm: [lec] initialize .netdev_ops before calling register_netdev()
fix oops when initializing lane interfaces. lec should probably be
changed to use alloc_netdev() instead.
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r-- | net/atm/lec.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index b2d644560323..42749b7b917c 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -62,7 +62,6 @@ static int lec_open(struct net_device *dev); | |||
62 | static netdev_tx_t lec_start_xmit(struct sk_buff *skb, | 62 | static netdev_tx_t lec_start_xmit(struct sk_buff *skb, |
63 | struct net_device *dev); | 63 | struct net_device *dev); |
64 | static int lec_close(struct net_device *dev); | 64 | static int lec_close(struct net_device *dev); |
65 | static void lec_init(struct net_device *dev); | ||
66 | static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, | 65 | static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, |
67 | const unsigned char *mac_addr); | 66 | const unsigned char *mac_addr); |
68 | static int lec_arp_remove(struct lec_priv *priv, | 67 | static int lec_arp_remove(struct lec_priv *priv, |
@@ -670,13 +669,6 @@ static const struct net_device_ops lec_netdev_ops = { | |||
670 | .ndo_set_multicast_list = lec_set_multicast_list, | 669 | .ndo_set_multicast_list = lec_set_multicast_list, |
671 | }; | 670 | }; |
672 | 671 | ||
673 | |||
674 | static void lec_init(struct net_device *dev) | ||
675 | { | ||
676 | dev->netdev_ops = &lec_netdev_ops; | ||
677 | printk("%s: Initialized!\n", dev->name); | ||
678 | } | ||
679 | |||
680 | static const unsigned char lec_ctrl_magic[] = { | 672 | static const unsigned char lec_ctrl_magic[] = { |
681 | 0xff, | 673 | 0xff, |
682 | 0x00, | 674 | 0x00, |
@@ -893,6 +885,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
893 | dev_lec[i] = alloc_etherdev(size); | 885 | dev_lec[i] = alloc_etherdev(size); |
894 | if (!dev_lec[i]) | 886 | if (!dev_lec[i]) |
895 | return -ENOMEM; | 887 | return -ENOMEM; |
888 | dev_lec[i]->netdev_ops = &lec_netdev_ops; | ||
896 | snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); | 889 | snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); |
897 | if (register_netdev(dev_lec[i])) { | 890 | if (register_netdev(dev_lec[i])) { |
898 | free_netdev(dev_lec[i]); | 891 | free_netdev(dev_lec[i]); |
@@ -901,7 +894,6 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
901 | 894 | ||
902 | priv = netdev_priv(dev_lec[i]); | 895 | priv = netdev_priv(dev_lec[i]); |
903 | priv->is_trdev = is_trdev; | 896 | priv->is_trdev = is_trdev; |
904 | lec_init(dev_lec[i]); | ||
905 | } else { | 897 | } else { |
906 | priv = netdev_priv(dev_lec[i]); | 898 | priv = netdev_priv(dev_lec[i]); |
907 | if (priv->lecd) | 899 | if (priv->lecd) |