Commit bd8ef6d3 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: x25 annotation

parent 6e3a9a7f
......@@ -196,7 +196,7 @@ extern void x25_transmit_restart_confirmation(struct x25_neigh *);
extern void x25_transmit_diagnostic(struct x25_neigh *, unsigned char);
extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char);
extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *);
extern int x25_subscr_ioctl(unsigned int, void *);
extern int x25_subscr_ioctl(unsigned int, void __user *);
extern struct x25_neigh *x25_get_neigh(struct net_device *);
extern void x25_link_free(void);
......@@ -221,7 +221,7 @@ extern void x25_enquiry_response(struct sock *);
extern struct x25_route *x25_get_route(struct x25_address *addr);
extern struct net_device *x25_dev_get(char *);
extern void x25_route_device_down(struct net_device *dev);
extern int x25_route_ioctl(unsigned int, void *);
extern int x25_route_ioctl(unsigned int, void __user *);
extern void x25_route_free(void);
static __inline__ void x25_route_hold(struct x25_route *rt)
......
......@@ -1180,6 +1180,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct sock *sk = sock->sk;
struct x25_opt *x25 = x25_sk(sk);
void __user *argp = (void __user *)arg;
int rc;
switch (cmd) {
......@@ -1188,7 +1189,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
atomic_read(&sk->sk_wmem_alloc);
if (amount < 0)
amount = 0;
rc = put_user(amount, (unsigned int *)arg);
rc = put_user(amount, (unsigned int __user *)argp);
break;
}
......@@ -1201,7 +1202,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
*/
if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
amount = skb->len;
rc = put_user(amount, (unsigned int *)arg);
rc = put_user(amount, (unsigned int __user *)argp);
break;
}
......@@ -1209,7 +1210,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -EINVAL;
if (sk)
rc = sock_get_timestamp(sk,
(struct timeval __user *)arg);
(struct timeval __user *)argp);
break;
case SIOCGIFADDR:
case SIOCSIFADDR:
......@@ -1228,20 +1229,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -EPERM;
if (!capable(CAP_NET_ADMIN))
break;
rc = x25_route_ioctl(cmd, (void *)arg);
rc = x25_route_ioctl(cmd, argp);
break;
case SIOCX25GSUBSCRIP:
rc = x25_subscr_ioctl(cmd, (void *)arg);
rc = x25_subscr_ioctl(cmd, argp);
break;
case SIOCX25SSUBSCRIP:
rc = -EPERM;
if (!capable(CAP_NET_ADMIN))
break;
rc = x25_subscr_ioctl(cmd, (void *)arg);
rc = x25_subscr_ioctl(cmd, argp);
break;
case SIOCX25GFACILITIES: {
struct x25_facilities fac = x25->facilities;
rc = copy_to_user((void *)arg, &fac,
rc = copy_to_user(argp, &fac,
sizeof(fac)) ? -EFAULT : 0;
break;
}
......@@ -1249,7 +1250,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25SFACILITIES: {
struct x25_facilities facilities;
rc = -EFAULT;
if (copy_from_user(&facilities, (void *)arg,
if (copy_from_user(&facilities, argp,
sizeof(facilities)))
break;
rc = -EINVAL;
......@@ -1277,7 +1278,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25GCALLUSERDATA: {
struct x25_calluserdata cud = x25->calluserdata;
rc = copy_to_user((void *)arg, &cud,
rc = copy_to_user(argp, &cud,
sizeof(cud)) ? -EFAULT : 0;
break;
}
......@@ -1286,7 +1287,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct x25_calluserdata calluserdata;
rc = -EFAULT;
if (copy_from_user(&calluserdata, (void *)arg,
if (copy_from_user(&calluserdata, argp,
sizeof(calluserdata)))
break;
rc = -EINVAL;
......@@ -1300,13 +1301,13 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25GCAUSEDIAG: {
struct x25_causediag causediag;
causediag = x25->causediag;
rc = copy_to_user((void *)arg, &causediag,
rc = copy_to_user(argp, &causediag,
sizeof(causediag)) ? -EFAULT : 0;
break;
}
default:
rc = dev_ioctl(cmd, (void __user *)arg);
rc = dev_ioctl(cmd, argp);
break;
}
......
......@@ -374,7 +374,7 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev)
/*
* Handle the ioctls that control the subscription functions.
*/
int x25_subscr_ioctl(unsigned int cmd, void *arg)
int x25_subscr_ioctl(unsigned int cmd, void __user *arg)
{
struct x25_subscrip_struct x25_subscr;
struct x25_neigh *nb;
......
......@@ -174,7 +174,7 @@ struct x25_route *x25_get_route(struct x25_address *addr)
/*
* Handle the ioctls that control the routing functions.
*/
int x25_route_ioctl(unsigned int cmd, void *arg)
int x25_route_ioctl(unsigned int cmd, void __user *arg)
{
struct x25_route_struct rt;
struct net_device *dev;
......
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