diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-01-12 12:38:02 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-18 09:15:16 +0200 |
commit | 954e2ed41fec684048824230eb51bed0eae449ba (patch) | |
tree | 3ba481b7076236ca21e06138d6c0e63ea5a5269b /sound/core | |
parent | 8ae04f638496b7a9b0381aecf5c47dcb5a3bd6fc (diff) | |
download | linux-stable-954e2ed41fec684048824230eb51bed0eae449ba.tar.gz linux-stable-954e2ed41fec684048824230eb51bed0eae449ba.tar.bz2 linux-stable-954e2ed41fec684048824230eb51bed0eae449ba.zip |
ALSA: seq: Fix missing NULL check at remove_events ioctl
commit 030e2c78d3a91dd0d27fef37e91950dde333eba1 upstream.
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 41347ad1c4d5..a3988a4bcfd6 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -1970,7 +1970,7 @@ static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, * No restrictions so for a user client we can clear * the whole fifo */ - if (client->type == USER_CLIENT) + if (client->type == USER_CLIENT && client->data.user.fifo) snd_seq_fifo_clear(client->data.user.fifo); } |