summaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2006-12-06 20:38:23 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:39 -0800
commit9d69b7d3d115d0db3ddd87f09e496db7ecf72650 (patch)
tree451e9009bf2c215c4d090424f9998d13f0a11959 /drivers/message
parentd3228a887cae75ef2b8b1211c31c539bef5a5698 (diff)
downloadlinux-9d69b7d3d115d0db3ddd87f09e496db7ecf72650.tar.bz2
[PATCH] I2O: handle __copy_from_user
Handle __copy_from_user() return value. Noticed by inspection, not from build warning. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/i2o/i2o_config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 7d23e082bf26..685d7a450720 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -265,7 +265,11 @@ static int i2o_cfg_swdl(unsigned long arg)
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] =