aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2014-03-27 18:36:38 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-29 17:58:37 -0400
commita8779ec1c5e60548b7b661a8d74a8cecf7775690 (patch)
tree26c3e8d991b42c16f48c99e4f9fd117233ae8b21 /net/8021q
parent3f705f73a0ab345321ef6e5a293c04bf7e9df818 (diff)
netpoll: Remove gfp parameter from __netpoll_setup
The gfp parameter was added in: commit 47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af Author: Amerigo Wang <amwang@redhat.com> Date: Fri Aug 10 01:24:37 2012 +0000 netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup() slave_enable_netpoll() and __netpoll_setup() may be called with read_lock() held, so should use GFP_ATOMIC to allocate memory. Eric suggested to pass gfp flags to __netpoll_setup(). Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> The reason for the gfp parameter was removed in: commit c4cdef9b7183159c23c7302aaf270d64c549f557 Author: dingtianhong <dingtianhong@huawei.com> Date: Tue Jul 23 15:25:27 2013 +0800 bonding: don't call slave_xxx_netpoll under spinlocks The slave_xxx_netpoll will call synchronize_rcu_bh(), so the function may schedule and sleep, it should't be called under spinlocks. bond_netpoll_setup() and bond_netpoll_cleanup() are always protected by rtnl lock, it is no need to take the read lock, as the slave list couldn't be changed outside rtnl lock. Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: David S. Miller <davem@davemloft.net> Nothing else that calls __netpoll_setup or ndo_netpoll_setup requires a gfp paramter, so remove the gfp parameter from both of these functions making the code clearer. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r--net/8021q/vlan_dev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 4f3e9073cb49..a78bebeca4d9 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -707,20 +707,19 @@ static void vlan_dev_poll_controller(struct net_device *dev)
707 return; 707 return;
708} 708}
709 709
710static int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo, 710static int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo)
711 gfp_t gfp)
712{ 711{
713 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); 712 struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
714 struct net_device *real_dev = vlan->real_dev; 713 struct net_device *real_dev = vlan->real_dev;
715 struct netpoll *netpoll; 714 struct netpoll *netpoll;
716 int err = 0; 715 int err = 0;
717 716
718 netpoll = kzalloc(sizeof(*netpoll), gfp); 717 netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL);
719 err = -ENOMEM; 718 err = -ENOMEM;
720 if (!netpoll) 719 if (!netpoll)
721 goto out; 720 goto out;
722 721
723 err = __netpoll_setup(netpoll, real_dev, gfp); 722 err = __netpoll_setup(netpoll, real_dev);
724 if (err) { 723 if (err) {
725 kfree(netpoll); 724 kfree(netpoll);
726 goto out; 725 goto out;