diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-11-19 11:21:27 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:09:16 -0500 |
commit | 9374074f9b8bfe15bd5860019d07d967507c2bb6 (patch) | |
tree | 0a4773e92454964e3fb8f342115085202e2f761e /drivers/pcmcia/pcmcia_ioctl.c | |
parent | 1d2c90425d5b0dcbf4a0fab2053d5087758b76a0 (diff) | |
download | linux-9374074f9b8bfe15bd5860019d07d967507c2bb6.tar.gz linux-9374074f9b8bfe15bd5860019d07d967507c2bb6.tar.bz2 linux-9374074f9b8bfe15bd5860019d07d967507c2bb6.zip |
[PATCH] pcmcia: handle __copy_from_user() return value in ioctl
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>
Diffstat (limited to 'drivers/pcmcia/pcmcia_ioctl.c')
-rw-r--r-- | drivers/pcmcia/pcmcia_ioctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index 310ede575caa..d077870c6731 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c @@ -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: |