projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac09a92
)
[ALSA] rawmidi: protect against invalid device number in snd_rawmidi_info_select()
author
Clemens Ladisch
<clemens@ladisch.de>
Sun, 20 Nov 2005 12:59:56 +0000
(13:59 +0100)
committer
Jaroslav Kysela
<perex@suse.cz>
Tue, 3 Jan 2006 11:29:12 +0000
(12:29 +0100)
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>
sound/core/rawmidi.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/core/rawmidi.c
b/sound/core/rawmidi.c
index 7a86a9a08a15e848dcb1488ac1dafc736729df47..d703545cae8a9ca004395a6dfb87ecc9ec92b849 100644
(file)
--- 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];