summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-06-03 00:05:35 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-03 03:28:23 -0700
commitd23380701876dd93d310b2548c51d0f78f25d7aa (patch)
tree37678ef819eb3bccb1c96498448e3a09a4aea35b
parent60a5711db646b87b9530b16cbaf3bd53ac5594a5 (diff)
downloadblackbird-obmc-linux-d23380701876dd93d310b2548c51d0f78f25d7aa.tar.gz
blackbird-obmc-linux-d23380701876dd93d310b2548c51d0f78f25d7aa.zip
tehuti: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bytes remaining but we want to return a negative error code here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/tehuti.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 20ab16192325..737df6032bbc 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -646,7 +646,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
error = copy_from_user(data, ifr->ifr_data, sizeof(data));
if (error) {
pr_err("cant copy from user\n");
- RET(error);
+ RET(-EFAULT);
}
DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
}
@@ -665,7 +665,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
data[2]);
error = copy_to_user(ifr->ifr_data, data, sizeof(data));
if (error)
- RET(error);
+ RET(-EFAULT);
break;
case BDX_OP_WRITE:
OpenPOWER on IntegriCloud