Commit d2338070 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60a5711d
...@@ -646,7 +646,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) ...@@ -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)); error = copy_from_user(data, ifr->ifr_data, sizeof(data));
if (error) { if (error) {
pr_err("cant copy from user\n"); pr_err("cant copy from user\n");
RET(error); RET(-EFAULT);
} }
DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); 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) ...@@ -665,7 +665,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
data[2]); data[2]);
error = copy_to_user(ifr->ifr_data, data, sizeof(data)); error = copy_to_user(ifr->ifr_data, data, sizeof(data));
if (error) if (error)
RET(error); RET(-EFAULT);
break; break;
case BDX_OP_WRITE: case BDX_OP_WRITE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment