copy_to_user check for sgiserial

davej@codemonkey.org.uk
Thu, 15 May 2003 04:31:12 +0100


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/sgi/char/sgiserial.c linux-2.5/drivers/sgi/char/sgiserial.c
--- bk-linus/drivers/sgi/char/sgiserial.c 2003-05-08 13:46:22.000000000 +0100
+++ linux-2.5/drivers/sgi/char/sgiserial.c 2003-05-08 14:26:46.000000000 +0100
@@ -1232,7 +1233,7 @@ static int get_serial_info(struct sgi_se
tmp.close_delay = info->close_delay;
tmp.closing_wait = info->closing_wait;
tmp.custom_divisor = info->custom_divisor;
- return copy_to_user(retinfo,&tmp,sizeof(*retinfo));
+ return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT : 0;
}

static int set_serial_info(struct sgi_serial * info,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/