patch-2.4.6 linux/drivers/sound/wf_midi.c

Next file: linux/drivers/sound/ymfpci.c
Previous file: linux/drivers/sound/wavfront.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/drivers/sound/wf_midi.c linux/drivers/sound/wf_midi.c
@@ -231,6 +231,7 @@
 				break;
 		    
 			default:
+				break;
 			}
 		} else {
 			mi->m_prev_status = midic;
@@ -590,19 +591,17 @@
 	switch (cmd) {
 
 	case SNDCTL_SYNTH_INFO:
-		copy_to_user (&((char *) arg)[0],
+		if(copy_to_user (&((char *) arg)[0],
 			      &wf_mpu_synth_info[index],
-			      sizeof (struct synth_info));
-	
+			      sizeof (struct synth_info)))
+			return -EFAULT;
 		return 0;
-		break;
 	
 	case SNDCTL_SYNTH_MEMAVL:
 		return 0x7fffffff;
-		break;
 	
 	default:
-		return -(EINVAL);
+		return -EINVAL;
 	}
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)