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

Next file: linux/drivers/cdrom/sbpcd.c
Previous file: linux/drivers/block/floppy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.59/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
@@ -1959,6 +1959,7 @@
 static int
 sony_get_subchnl_info(long arg)
 {
+   int err;
    struct cdrom_subchnl schi;
 
 
@@ -1972,8 +1973,9 @@
       return -EIO;
    }
 
-   verify_area(VERIFY_READ, (char *) arg, sizeof(schi));
-   verify_area(VERIFY_WRITE, (char *) arg, sizeof(schi));
+   err = verify_area(VERIFY_READ, (char *) arg, sizeof(schi)) ||
+         verify_area(VERIFY_WRITE, (char *) arg, sizeof(schi));
+   if (err) return err;
 
    memcpy_fromfs(&schi, (char *) arg, sizeof(schi));
    

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this