patch-2.4.23 linux-2.4.23/drivers/scsi/sg.c

Next file: linux-2.4.23/drivers/scsi/sun3_scsi.c
Previous file: linux-2.4.23/drivers/scsi/scsi_scan.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/drivers/scsi/sg.c linux-2.4.23/drivers/scsi/sg.c
@@ -871,6 +871,8 @@
     case SG_SET_RESERVED_SIZE:
         result = get_user(val, (int *)arg);
         if (result) return result;
+        if (val < 0)
+            return -EINVAL;
         if (val != sfp->reserve.bufflen) {
             if (sg_res_in_use(sfp) || sfp->mmap_called)
                 return -EBUSY;

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