Skip to content

Commit

Permalink
afs: Fix missing/incorrect unlocking of RCU read lock
Browse files Browse the repository at this point in the history
In afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both
places before returning (and not lock it again).

Fixes: f94f70d ("afs: Provide a way to configure address priorities")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202401172243.cd53d5f6-oliver.sang@intel.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
  • Loading branch information
David Howells committed Jan 22, 2024
1 parent cfcc005 commit b904935
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/afs/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v)

if (!preflist) {
seq_puts(m, "NO PREFS\n");
return 0;
goto out;
}

seq_printf(m, "PROT SUBNET PRIOR (v=%u n=%u/%u/%u)\n",
Expand All @@ -191,7 +191,8 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v)
}
}

rcu_read_lock();
out:
rcu_read_unlock();
return 0;
}

Expand Down

0 comments on commit b904935

Please sign in to comment.