mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
ALSA: rawmidi: Fix NULL dereference at proc read
commitb2ce0027d7
upstream. At the implementation of the optional proc fs in rawmidi, I forgot that rmidi->ops itself is optional and can be NULL. Add the proper NULL check for avoiding the Oops. Fixes:fa030f666d
("ALSA: ump: Additional proc output") Reported-and-tested-by: Mark Hills <mark@xwax.org> Closes: https://lore.kernel.org/r/ef9118c3-a2eb-d0ff-1efa-cc5fb6416bde@xwax.org Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20230916060725.11726-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3eb82c2bd4
commit
d8bbfab02d
1 changed files with 1 additions and 1 deletions
|
@ -1770,7 +1770,7 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
|
||||||
if (IS_ENABLED(CONFIG_SND_UMP))
|
if (IS_ENABLED(CONFIG_SND_UMP))
|
||||||
snd_iprintf(buffer, "Type: %s\n",
|
snd_iprintf(buffer, "Type: %s\n",
|
||||||
rawmidi_is_ump(rmidi) ? "UMP" : "Legacy");
|
rawmidi_is_ump(rmidi) ? "UMP" : "Legacy");
|
||||||
if (rmidi->ops->proc_read)
|
if (rmidi->ops && rmidi->ops->proc_read)
|
||||||
rmidi->ops->proc_read(entry, buffer);
|
rmidi->ops->proc_read(entry, buffer);
|
||||||
mutex_lock(&rmidi->open_mutex);
|
mutex_lock(&rmidi->open_mutex);
|
||||||
if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) {
|
if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) {
|
||||||
|
|
Loading…
Reference in a new issue