-+static void mesh_hdr_cache_entry_free(struct mesh_hdr_cache *cache,
-+ struct mhdr_cache_entry *entry)
-+{
-+ hlist_del_rcu(&entry->walk_list);
-+ rhashtable_remove_fast(&cache->rhead, &entry->rhash, mesh_hdr_rht_params);
-+ kfree_rcu(entry, rcu);
++ /*
++ * replace any previous entry in the hash table, in case we're
++ * replacing it with a different type (e.g. mpath -> mpp)
++ */
++ if (unlikely(old_mhdr)) {
++ rhashtable_replace_fast(&cache->rhead, &old_mhdr->rhash,
++ &mhdr->rhash, mesh_hdr_rht_params);
++ hlist_del_rcu(&old_mhdr->walk_list);
++ kfree_rcu(old_mhdr, rcu);
++ }
++
++ hlist_add_head(&mhdr->walk_list, &cache->walk_head);
++
++unlock_cache:
++ spin_unlock_bh(&cache->walk_lock);
++unlock_sta:
++ spin_unlock_bh(&sta->lock);