Skip to content

Commit

Permalink
Fix potential scheduling while atomic in mesh_path_add.
Browse files Browse the repository at this point in the history
Calling synchronize_rcu() under write-lock-ed pathtbl_resize_lock may
result in this warning (and other side effects).

It looks safe just dropping this lock before calling synchronize_rcu.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Pavel Emelyanov authored and John W. Linville committed May 13, 2008
1 parent 0eb03d5 commit 6d6936e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
return -ENOMEM;
}
rcu_assign_pointer(mesh_paths, newtbl);
write_unlock(&pathtbl_resize_lock);

synchronize_rcu();
mesh_table_free(oldtbl, false);
write_unlock(&pathtbl_resize_lock);
}
endadd2:
return err;
Expand Down

0 comments on commit 6d6936e

Please sign in to comment.