patch-2.1.88 linux/drivers/sound/mpu401.c

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

diff -u --recursive --new-file v2.1.87/linux/drivers/sound/mpu401.c linux/drivers/sound/mpu401.c
@@ -772,7 +772,9 @@
 			return -EFAULT;
 		if ((ret = mpu401_command(dev, &rec)) < 0)
 			return ret;
-		return __copy_to_user(arg, &rec, sizeof(rec));
+		if (__copy_to_user(arg, &rec, sizeof(rec)))
+			return -EFAULT;
+		return 0;
 
 	default:
 		return -EINVAL;

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