patch-2.4.5 linux/drivers/scsi/scsi_proc.c

Next file: linux/drivers/scsi/sd.c
Previous file: linux/drivers/scsi/scsi_lib.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/drivers/scsi/scsi_proc.c linux/drivers/scsi/scsi_proc.c
@@ -104,7 +104,11 @@
 
 	if (!(page = (char *) __get_free_page(GFP_KERNEL)))
 		return -ENOMEM;
-	copy_from_user(page, buf, count);
+	if(copy_from_user(page, buf, count))
+	{
+		free_page((ulong) page);
+		return -EFAULT;
+	}
 
 	if (hpnt->hostt->proc_info == NULL)
 		ret = -ENOSYS;

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