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

Next file: linux/drivers/sound/sb_common.c
Previous file: linux/drivers/sound/os.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.87/linux/drivers/sound/pss.c linux/drivers/sound/pss.c
@@ -546,7 +546,7 @@
 				mbuf->len = i;	/* feed back number of WORDs sent */
 				err = __copy_to_user(arg, mbuf, sizeof(copr_msg));
 				vfree(mbuf);
-				return err ? err : -EIO;
+				return err ? -EFAULT : -EIO;
 			}
 		}
 		restore_flags(flags);
@@ -594,7 +594,9 @@
 		}
 		dbuf.parm1 = tmp;
 		restore_flags(flags);
-		return __copy_to_user(arg, &dbuf, sizeof(dbuf));
+		if (__copy_to_user(arg, &dbuf, sizeof(dbuf)))
+			return -EFAULT;
+		return 0;
 		
 	case SNDCTL_COPR_WDATA:
 		if (__copy_from_user(&dbuf, arg, sizeof(dbuf)))
@@ -667,7 +669,9 @@
 		}
 		dbuf.parm1 |= tmp & 0x00ff;
 		restore_flags(flags);
-		return __copy_to_user(arg, &dbuf, sizeof(dbuf));
+		if (__copy_to_user(arg, &dbuf, sizeof(dbuf)))
+			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