diff options
Diffstat (limited to 'net/802/garp.c')
| -rw-r--r-- | net/802/garp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/802/garp.c b/net/802/garp.c index 5dbe8967bbd5..f8300a8b5fbc 100644 --- a/net/802/garp.c +++ b/net/802/garp.c | |||
| @@ -603,6 +603,11 @@ err1: | |||
| 603 | } | 603 | } |
| 604 | EXPORT_SYMBOL_GPL(garp_init_applicant); | 604 | EXPORT_SYMBOL_GPL(garp_init_applicant); |
| 605 | 605 | ||
| 606 | static void garp_app_kfree_rcu(struct rcu_head *head) | ||
| 607 | { | ||
| 608 | kfree(container_of(head, struct garp_applicant, rcu)); | ||
| 609 | } | ||
| 610 | |||
| 606 | void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl) | 611 | void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl) |
| 607 | { | 612 | { |
| 608 | struct garp_port *port = rtnl_dereference(dev->garp_port); | 613 | struct garp_port *port = rtnl_dereference(dev->garp_port); |
| @@ -611,7 +616,6 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl | |||
| 611 | ASSERT_RTNL(); | 616 | ASSERT_RTNL(); |
| 612 | 617 | ||
| 613 | rcu_assign_pointer(port->applicants[appl->type], NULL); | 618 | rcu_assign_pointer(port->applicants[appl->type], NULL); |
| 614 | synchronize_rcu(); | ||
| 615 | 619 | ||
| 616 | /* Delete timer and generate a final TRANSMIT_PDU event to flush out | 620 | /* Delete timer and generate a final TRANSMIT_PDU event to flush out |
| 617 | * all pending messages before the applicant is gone. */ | 621 | * all pending messages before the applicant is gone. */ |
| @@ -621,7 +625,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl | |||
| 621 | garp_queue_xmit(app); | 625 | garp_queue_xmit(app); |
| 622 | 626 | ||
| 623 | dev_mc_del(dev, appl->proto.group_address); | 627 | dev_mc_del(dev, appl->proto.group_address); |
| 624 | kfree(app); | 628 | call_rcu(&app->rcu, garp_app_kfree_rcu); |
| 625 | garp_release_port(dev); | 629 | garp_release_port(dev); |
| 626 | } | 630 | } |
| 627 | EXPORT_SYMBOL_GPL(garp_uninit_applicant); | 631 | EXPORT_SYMBOL_GPL(garp_uninit_applicant); |
| @@ -639,3 +643,9 @@ void garp_unregister_application(struct garp_application *appl) | |||
| 639 | stp_proto_unregister(&appl->proto); | 643 | stp_proto_unregister(&appl->proto); |
| 640 | } | 644 | } |
| 641 | EXPORT_SYMBOL_GPL(garp_unregister_application); | 645 | EXPORT_SYMBOL_GPL(garp_unregister_application); |
| 646 | |||
| 647 | static void __exit garp_cleanup_module(void) | ||
| 648 | { | ||
| 649 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ | ||
| 650 | } | ||
| 651 | module_exit(garp_cleanup_module); | ||
