patch-pre2.0.13 linux/drivers/char/vesa_blank.c

Next file: linux/drivers/net/lance.c
Previous file: linux/drivers/char/tty_io.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.12/linux/drivers/char/vesa_blank.c linux/drivers/char/vesa_blank.c
@@ -44,6 +44,7 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/segment.h>
+#include <linux/mm.h>
 
 extern unsigned short video_port_reg, video_port_val;
 
@@ -267,7 +268,12 @@
 void set_vesa_blanking(const unsigned long arg)
 {
 	unsigned char *argp = (unsigned char *)(arg + 1);
-	unsigned int mode = get_user(argp);
+	unsigned int mode;
+
+	if (verify_area(VERIFY_READ, argp, 1))
+		return;
+
+	mode = get_user(argp);
 	vesa_blanking_mode = suspend_vesa_blanking_mode =
 		((mode <= VESA_POWERDOWN) ? mode : DEFAULT_VESA_BLANKING_MODE);
 }

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