aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorchas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>2009-12-04 00:19:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-08 23:22:30 -0500
commiteb0445887a45a3705522aac6c2d8367e90358792 (patch)
tree12b489c8b9a1092fafa558c0496ef2ef1c3f7b6c /net
parent2a8875e73ffb18165ceb245f99c2ccad77378051 (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')
-rw-r--r--net/atm/lec.c10
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);
62static netdev_tx_t lec_start_xmit(struct sk_buff *skb, 62static netdev_tx_t lec_start_xmit(struct sk_buff *skb,
63 struct net_device *dev); 63 struct net_device *dev);
64static int lec_close(struct net_device *dev); 64static int lec_close(struct net_device *dev);
65static void lec_init(struct net_device *dev);
66static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, 65static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
67 const unsigned char *mac_addr); 66 const unsigned char *mac_addr);
68static int lec_arp_remove(struct lec_priv *priv, 67static 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
674static void lec_init(struct net_device *dev)
675{
676 dev->netdev_ops = &lec_netdev_ops;
677 printk("%s: Initialized!\n", dev->name);
678}
679
680static const unsigned char lec_ctrl_magic[] = { 672static 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)