Skip to content

Commit b904935

Browse files
committed
afs: Fix missing/incorrect unlocking of RCU read lock
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
1 parent cfcc005 commit b904935

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/afs/proc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v)
166166

167167
if (!preflist) {
168168
seq_puts(m, "NO PREFS\n");
169-
return 0;
169+
goto out;
170170
}
171171

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

194-
rcu_read_lock();
194+
out:
195+
rcu_read_unlock();
195196
return 0;
196197
}
197198

0 commit comments

Comments
 (0)