Modules: RawMidi Midlevel
In snd_rawmidi_info_select(), check that the device identified by the
passed device number actually exists.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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];