Commit 62bb080f authored by Herbert Xu's avatar Herbert Xu Committed by Greg Kroah-Hartman
Browse files

mac80211: Free mpath object when rhashtable insertion fails

commit 4ff3a9d1


When rhashtable insertion fails the mesh table code doesn't free
the now-orphan mesh path object.  This patch fixes that.

Signed-off-by: default avatarHerbert Xu <>
Signed-off-by: default avatarJohannes Berg <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 5f9d7b24
......@@ -448,17 +448,15 @@ struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata,
} while (unlikely(ret == -EEXIST && !mpath));
if (ret && ret != -EEXIST)
return ERR_PTR(ret);
/* At this point either new_mpath was added, or we found a
* matching entry already in the table; in the latter case
* free the unnecessary new entry.
if (ret == -EEXIST) {
if (ret) {
if (ret != -EEXIST)
return ERR_PTR(ret);
new_mpath = mpath;
return new_mpath;
......@@ -488,6 +486,9 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata,
if (ret)
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment