patch-2.1.126 linux/drivers/cdrom/cdu31a.c

Next file: linux/drivers/char/Config.in
Previous file: linux/drivers/block/xd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
@@ -3020,18 +3020,20 @@
          sony_get_toc();
          if (!sony_toc_read)
          {
-            return -EIO;
+         	return -EIO;
          }
-         
+
+	 if(copy_from_user(&ra, (char *) arg, sizeof(ra)))
+	 	return -EFAULT;
+
          if (ra.nframes == 0)
          {
-            return 0;
+         	return 0;
          }
 
          i=verify_area(VERIFY_WRITE, ra.buf, CD_FRAMESIZE_RAW * ra.nframes);
          if(i<0)
          	return i;
-         copy_from_user(&ra, (char *) arg, sizeof(ra));
 
          if (ra.addr_format == CDROM_LBA)
          {

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