[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>
This commit is contained in:
Randy Dunlap 2006-12-06 20:38:23 -08:00 committed by Linus Torvalds
parent d3228a887c
commit 9d69b7d3d1

View File

@ -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] =