From: Ivan Mikhaylov Date: Wed, 14 Sep 2016 16:06:45 +0000 (+0300) Subject: net/ibm/emac: add mutex to 'set multicast list' X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7106a069f45b15e63d14484e72969e64798e641c;p=openwrt%2Fstaging%2Fblogic.git net/ibm/emac: add mutex to 'set multicast list' for preventing race conditions within ioctl calls. Signed-off-by: Ivan Mikhaylov Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 2dfc60308648..7af09cbc53f0 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c @@ -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)