Skip to content

Commit 030e2c7

Browse files
committed
ALSA: seq: Fix missing NULL check at remove_events ioctl
snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear() unconditionally even if there is no FIFO assigned, and this leads to an Oops due to NULL dereference. The fix is just to add a proper NULL check. Reported-by: Dmitry Vyukov <dvyukov@google.com> Tested-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 5c06d68 commit 030e2c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: sound/core/seq/seq_clientmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ static int snd_seq_ioctl_remove_events(struct snd_seq_client *client,
19621962
* No restrictions so for a user client we can clear
19631963
* the whole fifo
19641964
*/
1965-
if (client->type == USER_CLIENT)
1965+
if (client->type == USER_CLIENT && client->data.user.fifo)
19661966
snd_seq_fifo_clear(client->data.user.fifo);
19671967
}
19681968

0 commit comments

Comments
 (0)