Skip to content

Commit

Permalink
Staging: batman-adv: wait for call_rcu before unloading module
Browse files Browse the repository at this point in the history
synchronize_rcu respective synchronize_net only waits for the rcu grace
period to elapse and we may fail to finish the calls which were made to
call_rcu in that time. In result the module could be unloaded during the
execution of the RCU callbacks.

rcu_barrier[1] will now wait for all outstanding RCU callbacks to finish
before continuing.

[1] Documentation/RCU/rcubarrier.txt

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Sep 20, 2010
1 parent 2d77bb5 commit 67c3b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static void __exit batman_exit(void)
destroy_workqueue(bat_event_workqueue);
bat_event_workqueue = NULL;

synchronize_net();
rcu_barrier();
}

int mesh_init(struct net_device *soft_iface)
Expand Down

0 comments on commit 67c3b70

Please sign in to comment.