aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-02-23 04:06:48 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-23 17:11:30 -0500
commitc3f52ae6a378398127acb845087ddb9e8b67493b (patch)
treefb68840354fe33891f7e0baf035b5a1d8dbee98f /net/socket.c
parente13e02a3c68d899169c78d9a18689bd73491d59a (diff)
socket: suppress sparse warnings
Use __force to quiet sparse warnings for cases where the code is simulating user space pointers. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c
index 9fa1e3b4366e..937d0fcf74bc 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2648,7 +2648,8 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
2648 2648
2649 old_fs = get_fs(); 2649 old_fs = get_fs();
2650 set_fs(KERNEL_DS); 2650 set_fs(KERNEL_DS);
2651 err = dev_ioctl(net, cmd, &kifr); 2651 err = dev_ioctl(net, cmd,
2652 (struct ifreq __user __force *) &kifr);
2652 set_fs(old_fs); 2653 set_fs(old_fs);
2653 2654
2654 return err; 2655 return err;
@@ -2757,7 +2758,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
2757 2758
2758 old_fs = get_fs(); 2759 old_fs = get_fs();
2759 set_fs(KERNEL_DS); 2760 set_fs(KERNEL_DS);
2760 err = dev_ioctl(net, cmd, (void __user *)&ifr); 2761 err = dev_ioctl(net, cmd, (void __user __force *)&ifr);
2761 set_fs(old_fs); 2762 set_fs(old_fs);
2762 2763
2763 if (cmd == SIOCGIFMAP && !err) { 2764 if (cmd == SIOCGIFMAP && !err) {
@@ -2862,7 +2863,8 @@ static int routing_ioctl(struct net *net, struct socket *sock,
2862 ret |= __get_user(rtdev, &(ur4->rt_dev)); 2863 ret |= __get_user(rtdev, &(ur4->rt_dev));
2863 if (rtdev) { 2864 if (rtdev) {
2864 ret |= copy_from_user(devname, compat_ptr(rtdev), 15); 2865 ret |= copy_from_user(devname, compat_ptr(rtdev), 15);
2865 r4.rt_dev = devname; devname[15] = 0; 2866 r4.rt_dev = (char __user __force *)devname;
2867 devname[15] = 0;
2866 } else 2868 } else
2867 r4.rt_dev = NULL; 2869 r4.rt_dev = NULL;
2868 2870