aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/plip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/plip.c')
-rw-r--r--drivers/net/plip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 7e82a82422cf..ca4df7f4cf21 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -995,8 +995,10 @@ plip_tx_packet(struct sk_buff *skb, struct net_device *dev)
995static void 995static void
996plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth) 996plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
997{ 997{
998 const struct in_device *in_dev = dev->ip_ptr; 998 const struct in_device *in_dev;
999 999
1000 rcu_read_lock();
1001 in_dev = __in_dev_get_rcu(dev);
1000 if (in_dev) { 1002 if (in_dev) {
1001 /* Any address will do - we take the first */ 1003 /* Any address will do - we take the first */
1002 const struct in_ifaddr *ifa = in_dev->ifa_list; 1004 const struct in_ifaddr *ifa = in_dev->ifa_list;
@@ -1006,6 +1008,7 @@ plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
1006 memcpy(eth->h_dest+2, &ifa->ifa_address, 4); 1008 memcpy(eth->h_dest+2, &ifa->ifa_address, 4);
1007 } 1009 }
1008 } 1010 }
1011 rcu_read_unlock();
1009} 1012}
1010 1013
1011static int 1014static int
@@ -1088,7 +1091,8 @@ plip_open(struct net_device *dev)
1088 when the device address isn't identical to the address of a 1091 when the device address isn't identical to the address of a
1089 received frame, the kernel incorrectly drops it). */ 1092 received frame, the kernel incorrectly drops it). */
1090 1093
1091 if ((in_dev=dev->ip_ptr) != NULL) { 1094 in_dev=__in_dev_get_rtnl(dev);
1095 if (in_dev) {
1092 /* Any address will do - we take the first. We already 1096 /* Any address will do - we take the first. We already
1093 have the first two bytes filled with 0xfc, from 1097 have the first two bytes filled with 0xfc, from
1094 plip_init_dev(). */ 1098 plip_init_dev(). */