public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add missing checks of __copy_to_user return value in i2o_config.c
@ 2004-10-05 21:43 Jesper Juhl
  2004-10-05 22:21 ` Andrew Morton
  2004-10-06 10:41 ` Christoph Hellwig
  0 siblings, 2 replies; 9+ messages in thread
From: Jesper Juhl @ 2004-10-05 21:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Markus Lidel, Alan Cox


This patch fixes up the following :

  CC      drivers/message/i2o/i2o_config.o
include/asm/uaccess.h: In function `i2o_cfg_getiops':
drivers/message/i2o/i2o_config.c:190: warning: ignoring return value of `__copy_to_user', declared with attribute warn_unused_result
include/asm/uaccess.h: In function `i2o_cfg_swul':
drivers/message/i2o/i2o_config.c:477: warning: ignoring return value of `__copy_to_user', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

diff -up linux-2.6.9-rc3-bk5-orig/drivers/message/i2o/i2o_config.c linux-2.6.9-rc3-bk5/drivers/message/i2o/i2o_config.c
--- linux-2.6.9-rc3-bk5-orig/drivers/message/i2o/i2o_config.c	2004-09-30 05:05:40.000000000 +0200
+++ linux-2.6.9-rc3-bk5/drivers/message/i2o/i2o_config.c	2004-10-05 23:32:43.000000000 +0200
@@ -187,7 +187,8 @@ static int i2o_cfg_getiops(unsigned long
 	list_for_each_entry(c, &i2o_controllers, list)
 	    tmp[c->unit] = 1;
 
-	__copy_to_user(user_iop_table, tmp, MAX_I2O_CONTROLLERS);
+	if (__copy_to_user(user_iop_table, tmp, MAX_I2O_CONTROLLERS))
+		return -EFAULT;
 
 	return 0;
 };
@@ -474,7 +475,9 @@ static int i2o_cfg_swul(unsigned long ar
 		return status;
 	}
 
-	__copy_to_user(kxfer.buf, buffer.virt, fragsize);
+	if (__copy_to_user(kxfer.buf, buffer.virt, fragsize))
+		return -EFAULT;
+
 	i2o_dma_free(&c->pdev->dev, &buffer);
 
 	return 0;



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-10-08  0:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-05 21:43 [PATCH] add missing checks of __copy_to_user return value in i2o_config.c Jesper Juhl
2004-10-05 22:21 ` Andrew Morton
2004-10-05 22:34   ` Jesper Juhl
2004-10-05 22:43     ` Andrew Morton
2004-10-05 23:11       ` Jesper Juhl
2004-10-06 10:41 ` Christoph Hellwig
2004-10-06 20:11   ` Jesper Juhl
2004-10-07 21:01     ` Markus Lidel
2004-10-08  0:23       ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox