* [PATCH] I2O: handle __copy_from_user
@ 2006-11-18 5:54 Randy Dunlap
0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2006-11-18 5:54 UTC (permalink / raw)
To: lkml; +Cc: markus.lidel, akpm
From: Randy Dunlap <randy.dunlap@oracle.com>
Handle __copy_from_user() return value.
Noticed by inspection, not from build warning.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
drivers/message/i2o/i2o_config.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- linux-2619-rc5mm2.orig/drivers/message/i2o/i2o_config.c
+++ linux-2619-rc5mm2/drivers/message/i2o/i2o_config.c
@@ -265,7 +265,11 @@ static int i2o_cfg_swdl(unsigned long ar
return -ENOMEM;
}
- __copy_from_user(buffer.virt, kxfer.buf, fragsize);
+ if (__copy_from_user(buffer.virt, kxfer.buf, fragsize)) {
+ i2o_msg_nop(c, msg);
+ i2o_dma_free(&c->pdev->dev, &buffer);
+ return -EFAULT;
+ }
msg->u.head[0] = cpu_to_le32(NINE_WORD_MSG_SIZE | SGL_OFFSET_7);
msg->u.head[1] =
---
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-18 5:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-18 5:54 [PATCH] I2O: handle __copy_from_user Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®