summaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2013-02-11 06:22:28 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-11 14:16:26 -0500
commit954b1244530064d48dde133f906026e56ba0ae56 (patch)
tree0ddd53876256330982b1d36b1752a737dd1963b5 /net/socket.c
parentb2748267d6487857f1400dc42748c5409e0ee130 (diff)
ethtool: fix sparse warning
Fixes sparse complaints about dropping __user in casts. warning: cast removes address space of expression Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/socket.c b/net/socket.c
index 5c4d82c0529..ee0d029e513 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2837,7 +2837,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
}
ifr = compat_alloc_user_space(buf_size);
- rxnfc = (void *)ifr + ALIGN(sizeof(struct ifreq), 8);
+ rxnfc = (void __user *)ifr + ALIGN(sizeof(struct ifreq), 8);
if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
return -EFAULT;
@@ -2861,12 +2861,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
offsetof(struct ethtool_rxnfc, fs.ring_cookie));
if (copy_in_user(rxnfc, compat_rxnfc,
- (void *)(&rxnfc->fs.m_ext + 1) -
- (void *)rxnfc) ||
+ (void __user *)(&rxnfc->fs.m_ext + 1) -
+ (void __user *)rxnfc) ||
copy_in_user(&rxnfc->fs.ring_cookie,
&compat_rxnfc->fs.ring_cookie,
- (void *)(&rxnfc->fs.location + 1) -
- (void *)&rxnfc->fs.ring_cookie) ||
+ (void __user *)(&rxnfc->fs.location + 1) -
+ (void __user *)&rxnfc->fs.ring_cookie) ||
copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
sizeof(rxnfc->rule_cnt)))
return -EFAULT;
@@ -2878,12 +2878,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
if (convert_out) {
if (copy_in_user(compat_rxnfc, rxnfc,
- (const void *)(&rxnfc->fs.m_ext + 1) -
- (const void *)rxnfc) ||
+ (const void __user *)(&rxnfc->fs.m_ext + 1) -
+ (const void __user *)rxnfc) ||
copy_in_user(&compat_rxnfc->fs.ring_cookie,
&rxnfc->fs.ring_cookie,
- (const void *)(&rxnfc->fs.location + 1) -
- (const void *)&rxnfc->fs.ring_cookie) ||
+ (const void __user *)(&rxnfc->fs.location + 1) -
+ (const void __user *)&rxnfc->fs.ring_cookie) ||
copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
sizeof(rxnfc->rule_cnt)))
return -EFAULT;