aboutsummaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/rawmidi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 7a86a9a08a1..d703545cae8 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -573,6 +573,8 @@ int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info
if (info->device >= SNDRV_RAWMIDI_DEVICES)
return -ENXIO;
rmidi = snd_rawmidi_devices[card->number * SNDRV_RAWMIDI_DEVICES + info->device];
+ if (!rmidi)
+ return -ENXIO;
if (info->stream < 0 || info->stream > 1)
return -EINVAL;
pstr = &rmidi->streams[info->stream];