OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a40a393
)
ALSA: opl3: Fix possible negative array index access
author
Takashi Iwai
<tiwai@suse.de>
Tue, 29 Oct 2013 14:07:19 +0000
(15:07 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Tue, 29 Oct 2013 14:07:19 +0000
(15:07 +0100)
Spotted by coverity CID 115196.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/opl3/opl3_midi.c
patch
|
blob
|
history
diff --git
a/sound/drivers/opl3/opl3_midi.c
b/sound/drivers/opl3/opl3_midi.c
index
0c796bc
..
6c6d09a
100644
(file)
--- a/
sound/drivers/opl3/opl3_midi.c
+++ b/
sound/drivers/opl3/opl3_midi.c
@@
-390,6
+390,11
@@
void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
voice = snd_opl3_oss_map[chan->number];
}
+ if (voice < 0) {
+ spin_unlock_irqrestore(&opl3->voice_lock, flags);
+ return;
+ }
+
if (voice < MAX_OPL2_VOICES) {
/* Left register block for voices 0 .. 8 */
reg_side = OPL3_LEFT;