aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/garp.h1
-rw-r--r--net/802/garp.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/include/net/garp.h b/include/net/garp.h
index f4c295984c45..8cabbf087169 100644
--- a/include/net/garp.h
+++ b/include/net/garp.h
@@ -108,6 +108,7 @@ struct garp_applicant {
108 108
109struct garp_port { 109struct garp_port {
110 struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1]; 110 struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1];
111 struct rcu_head rcu;
111}; 112};
112 113
113extern int garp_register_application(struct garp_application *app); 114extern int garp_register_application(struct garp_application *app);
diff --git a/net/802/garp.c b/net/802/garp.c
index c1df2dad8c6b..5dbe8967bbd5 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -544,6 +544,11 @@ static int garp_init_port(struct net_device *dev)
544 return 0; 544 return 0;
545} 545}
546 546
547static void garp_kfree_rcu(struct rcu_head *head)
548{
549 kfree(container_of(head, struct garp_port, rcu));
550}
551
547static void garp_release_port(struct net_device *dev) 552static void garp_release_port(struct net_device *dev)
548{ 553{
549 struct garp_port *port = rtnl_dereference(dev->garp_port); 554 struct garp_port *port = rtnl_dereference(dev->garp_port);
@@ -554,8 +559,7 @@ static void garp_release_port(struct net_device *dev)
554 return; 559 return;
555 } 560 }
556 rcu_assign_pointer(dev->garp_port, NULL); 561 rcu_assign_pointer(dev->garp_port, NULL);
557 synchronize_rcu(); 562 call_rcu(&port->rcu, garp_kfree_rcu);
558 kfree(port);
559} 563}
560 564
561int garp_init_applicant(struct net_device *dev, struct garp_application *appl) 565int garp_init_applicant(struct net_device *dev, struct garp_application *appl)