Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: opl3: Fix possible negative array index access

Spotted by coverity CID 115196.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+5
+5
sound/drivers/opl3/opl3_midi.c
··· 390 390 voice = snd_opl3_oss_map[chan->number]; 391 391 } 392 392 393 + if (voice < 0) { 394 + spin_unlock_irqrestore(&opl3->voice_lock, flags); 395 + return; 396 + } 397 + 393 398 if (voice < MAX_OPL2_VOICES) { 394 399 /* Left register block for voices 0 .. 8 */ 395 400 reg_side = OPL3_LEFT;