Skip to content

Commit

Permalink
mac80211: remove pointless mesh path timer RCU code
Browse files Browse the repository at this point in the history
The code here to RCU-dereference a pointer that's
on the stack is totally pointless, RCU isn't magic
(like say Java's weak references are), so the code
can't work like whoever wrote it thought it might.

Remove it so readers don't get confused. Note that
it seems that a bug is there anyway: I don't see
any code that cancels the timer when a mesh path
struct is destroyed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 12, 2011
1 parent be0e6aa commit dea4096
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions net/mac80211/mesh_hwmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,20 +966,11 @@ int mesh_nexthop_lookup(struct sk_buff *skb,

void mesh_path_timer(unsigned long data)
{
struct ieee80211_sub_if_data *sdata;
struct mesh_path *mpath;

rcu_read_lock();
mpath = (struct mesh_path *) data;
mpath = rcu_dereference(mpath);
if (!mpath)
goto endmpathtimer;
sdata = mpath->sdata;
struct mesh_path *mpath = (void *) data;
struct ieee80211_sub_if_data *sdata = mpath->sdata;

if (sdata->local->quiescing) {
rcu_read_unlock();
if (sdata->local->quiescing)
return;
}

spin_lock_bh(&mpath->state_lock);
if (mpath->flags & MESH_PATH_RESOLVED ||
Expand All @@ -996,8 +987,6 @@ void mesh_path_timer(unsigned long data)
}

spin_unlock_bh(&mpath->state_lock);
endmpathtimer:
rcu_read_unlock();
}

void
Expand Down

0 comments on commit dea4096

Please sign in to comment.