Skip to content

Commit 3510c7a

Browse files
committed
ALSA: seq: Avoid invalid lockdep class warning
The recent fix for adding rwsem nesting annotation was using the given "hop" argument as the lock subclass key. Although the idea itself works, it may trigger a kernel warning like: BUG: looking up invalid subclass: 8 .... since the lockdep has a smaller number of subclasses (8) than we currently allow for the hops there (10). The current definition is merely a sanity check for avoiding the too deep delivery paths, and the 8 hops are already enough. So, as a quick fix, just follow the max hops as same as the max lockdep subclasses. Fixes: 1f20f9f ("ALSA: seq: Fix nested rwsem annotation for lockdep splat") Reported-by: syzbot <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 9b7d869 commit 3510c7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/sound/seq_kernel.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
4949
#define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
5050

5151
/* max delivery path length */
52-
#define SNDRV_SEQ_MAX_HOPS 10
52+
/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
53+
#define SNDRV_SEQ_MAX_HOPS 8
5354

5455
/* max size of event size */
5556
#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff

0 commit comments

Comments
 (0)