aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/eth_media.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 0ee6ded18f3a..77d2d9ce8962 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -120,18 +120,20 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
120 120
121static int enable_bearer(struct tipc_bearer *tb_ptr) 121static int enable_bearer(struct tipc_bearer *tb_ptr)
122{ 122{
123 struct net_device *dev, *pdev; 123 struct net_device *dev = NULL;
124 struct net_device *pdev = NULL;
124 struct eth_bearer *eb_ptr = &eth_bearers[0]; 125 struct eth_bearer *eb_ptr = &eth_bearers[0];
125 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; 126 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
126 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; 127 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
127 128
128 /* Find device with specified name */ 129 /* Find device with specified name */
129 dev = NULL; 130
130 for_each_netdev(pdev) 131 for_each_netdev(pdev){
131 if (!strncmp(dev->name, driver_name, IFNAMSIZ)) { 132 if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
132 dev = pdev; 133 dev = pdev;
133 break; 134 break;
134 } 135 }
136 }
135 if (!dev) 137 if (!dev)
136 return -ENODEV; 138 return -ENODEV;
137 139