From 9374074f9b8bfe15bd5860019d07d967507c2bb6 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 19 Nov 2006 11:21:27 -0500 Subject: [PATCH] [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 --- drivers/pcmcia/pcmcia_ioctl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index 310ede575ca..d077870c673 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: -- 2.41.1