net/ibm/emac: add mutex to 'set multicast list'
authorIvan Mikhaylov <ivan@de.ibm.com>
Wed, 14 Sep 2016 16:06:45 +0000 (19:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Sep 2016 08:21:47 +0000 (04:21 -0400)
for preventing race conditions within ioctl calls.

Signed-off-by: Ivan Mikhaylov <ivan@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/emac/core.c

index 2dfc60308648153b9cdea7fba12f7742687a0d77..7af09cbc53f079114a167d21d7433643930d15fa 100644 (file)
@@ -977,7 +977,10 @@ static void emac_set_multicast_list(struct net_device *ndev)
                dev->mcast_pending = 1;
                return;
        }
+
+       mutex_lock(&dev->link_lock);
        __emac_set_multicast_list(dev);
+       mutex_unlock(&dev->link_lock);
 }
 
 static int emac_set_mac_address(struct net_device *ndev, void *sa)