patch-2.0.31 linux/drivers/sound/sequencer.c

Next file: linux/fs/Config.in
Previous file: linux/drivers/sound/sb_common.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.30/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
@@ -1592,7 +1592,7 @@
 	return -(EIO);
 
       midi_dev = get_user ((int *) arg);
-      if (midi_dev >= max_mididev)
+      if (midi_dev < 0 || midi_dev >= max_mididev)
 	return -(ENXIO);
 
       if (!midi_opened[midi_dev])
@@ -2038,7 +2038,7 @@
   iqueue = (unsigned char *) (sound_mem_blocks[sound_nblocks] = vmalloc (SEQ_MAX_QUEUE * IEV_SZ));
   if (sound_nblocks < 1024)
     sound_nblocks++;;
-  if (queue == NULL)
+  if (iqueue == NULL)
     {
       printk ("Sound: Can't allocate memory for sequencer input queue\n");
       return;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov