Skip to content

Commit

Permalink
bonding: drop read_lock in bond_fix_features
Browse files Browse the repository at this point in the history
We're protected by RTNL so nothing can happen and we can safely drop the
read bond->lock.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
nikolay@redhat.com authored and David S. Miller committed Sep 4, 2013
1 parent c509316 commit 9b7b165
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,18 +1084,16 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)
/*---------------------------------- IOCTL ----------------------------------*/

static netdev_features_t bond_fix_features(struct net_device *dev,
netdev_features_t features)
netdev_features_t features)
{
struct slave *slave;
struct bonding *bond = netdev_priv(dev);
netdev_features_t mask;

read_lock(&bond->lock);
struct slave *slave;

if (list_empty(&bond->slave_list)) {
/* Disable adding VLANs to empty bond. But why? --mq */
features |= NETIF_F_VLAN_CHALLENGED;
goto out;
return features;
}

mask = features;
Expand All @@ -1109,8 +1107,6 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
}
features = netdev_add_tso_features(features, mask);

out:
read_unlock(&bond->lock);
return features;
}

Expand Down

0 comments on commit 9b7b165

Please sign in to comment.