Skip to content

Commit

Permalink
[PATCH] I2O: handle __copy_from_user
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Randy Dunlap authored and Linus Torvalds committed Dec 7, 2006
1 parent d3228a8 commit 9d69b7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/message/i2o/i2o_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down

0 comments on commit 9d69b7d

Please sign in to comment.