Skip to content

Commit

Permalink
[PATCH] pcmcia: handle __copy_from_user() return value in ioctl
Browse files Browse the repository at this point in the history
Handle __copy_from_user() return value.

drivers/pcmcia/pcmcia_ioctl.c:597: warning: ignoring return value of '__copy_from_user', declared with attribute warn_unused_result

Noticed and first fix by Randy Dunlap.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Dec 5, 2006
1 parent 1d2c904 commit 9374074
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pcmcia/pcmcia_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,12 @@ static int ds_ioctl(struct inode * inode, struct file * file,

err = ret = 0;

if (cmd & IOC_IN) __copy_from_user((char *)buf, uarg, size);
if (cmd & IOC_IN) {
if (__copy_from_user((char *)buf, uarg, size)) {
err = -EFAULT;
goto free_out;
}
}

switch (cmd) {
case DS_ADJUST_RESOURCE_INFO:
Expand Down

0 comments on commit 9374074

Please sign in to comment.