diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/eth_media.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 67bb29b44d1b..0ee6ded18f3a 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
@@ -120,16 +120,18 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
120 | 120 | ||
121 | static int enable_bearer(struct tipc_bearer *tb_ptr) | 121 | static int enable_bearer(struct tipc_bearer *tb_ptr) |
122 | { | 122 | { |
123 | struct net_device *dev = dev_base; | 123 | struct net_device *dev, *pdev; |
124 | struct eth_bearer *eb_ptr = ð_bearers[0]; | 124 | struct eth_bearer *eb_ptr = ð_bearers[0]; |
125 | struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS]; | 125 | struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS]; |
126 | char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; | 126 | char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; |
127 | 127 | ||
128 | /* Find device with specified name */ | 128 | /* Find device with specified name */ |
129 | 129 | dev = NULL; | |
130 | while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) { | 130 | for_each_netdev(pdev) |
131 | dev = dev->next; | 131 | if (!strncmp(dev->name, driver_name, IFNAMSIZ)) { |
132 | } | 132 | dev = pdev; |
133 | break; | ||
134 | } | ||
133 | if (!dev) | 135 | if (!dev) |
134 | return -ENODEV; | 136 | return -ENODEV; |
135 | 137 | ||