diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-10-07 19:20:37 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-08 08:47:06 +0200 |
| commit | 8bd561f8a6051f4e287dd0d076f17a1af5bff009 (patch) | |
| tree | f4d5c0b89c889a47b1a5c4d00a001bd2e7b45b0d /tools/lib/python | |
| parent | c3e35f355fadf6be660e1fd356bb22140dda8e46 (diff) | |
ALSA: seq: Drop the bogus RCU guard from clientptr()
In the recent refactoring with RCU, clientptr() takes guard(rcu)()
around the client table lookup, but the RCU read-side section ends as
soon as the function returns, so the returned pointer isn't protected
at all. This gives a false impression as if that the callers were
safe, and confuse reviewers including Sashiko.
Actually, the callers (snd_seq_delete_kernel_client(),
snd_seq_kernel_client_ctl() and snd_seq_kernel_client_write_poll())
never relied on any lock; the caller is the owner of the client (a
kernel client passing its own id, or a user client via its opened
file), hence the client can't be released concurrently by others.
So just drop the confusing and useless RCU guard, read the table via
rcu_dereference_protected(), and document the lifetime rule. Along
with it, fold __clientptr() into its only user client_use_ptr(); the
id range is already checked there, and it's never called with
clients_lock held, so a plain rcu_dereference() suffices.
Fixes: 7a287e4615d6 ("ALSA: seq: Use RCU for the client table")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172051.13240-2-tiwai@suse.de
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
