Skip to content
Permalink
Browse files
net: missing lock releases in ipmr_base.c
In method mr_mfc_seq_idx, the lock it->lock and rcu_read_lock are not released when pos-- == 0 is true.

Signed-off-by: Ryan Cai <ycaibb@gmail.com>
  • Loading branch information
ycaibb authored and intel-lab-lkp committed Jan 21, 2022
1 parent 8aaaf2f commit 33b03feacaf2155323b031274d2d67dab0cf561c
Showing 1 changed file with 2 additions and 0 deletions.
@@ -154,13 +154,15 @@ void *mr_mfc_seq_idx(struct net *net,
it->cache = &mrt->mfc_cache_list;
list_for_each_entry_rcu(mfc, &mrt->mfc_cache_list, list)
if (pos-- == 0)
rcu_read_unlock();
return mfc;
rcu_read_unlock();

spin_lock_bh(it->lock);
it->cache = &mrt->mfc_unres_queue;
list_for_each_entry(mfc, it->cache, list)
if (pos-- == 0)
spin_unlock_bh(it->lock);
return mfc;
spin_unlock_bh(it->lock);

0 comments on commit 33b03fe

Please sign in to comment.