Commit 43638f5e authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: sctp annotation

parent c277c852
......@@ -437,13 +437,13 @@ struct sctp_af {
int (*setsockopt) (struct sock *sk,
int level,
int optname,
char *optval,
char __user *optval,
int optlen);
int (*getsockopt) (struct sock *sk,
int level,
int optname,
char *optval,
int *optlen);
char __user *optval,
int __user *optlen);
struct dst_entry *(*get_dst) (struct sctp_association *asoc,
union sctp_addr *daddr,
union sctp_addr *saddr);
......
......@@ -559,7 +559,7 @@ struct sctp_status {
struct sctp_getaddrs {
sctp_assoc_t assoc_id;
int addr_num;
struct sockaddr *addrs;
struct sockaddr __user *addrs;
};
/* These are bit fields for msghdr->msg_flags. See section 5.1. */
......
......@@ -2799,7 +2799,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
if (len != sizeof(struct sctp_paddrparams))
return -EINVAL;
if (copy_from_user(&params, optval, *optlen)) /* XXXXXX */
if (copy_from_user(&params, optval, len))
return -EFAULT;
trans = sctp_addr_id2transport(sk, &params.spp_address,
......@@ -2969,7 +2969,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
int cnt = 0;
struct sctp_getaddrs getaddrs;
struct sctp_sockaddr_entry *from;
void *to;
void __user *to;
union sctp_addr temp;
struct sctp_opt *sp = sctp_sk(sk);
int addrlen;
......@@ -2996,7 +2996,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
bp = &asoc->base.bind_addr;
}
to = (void *)getaddrs.addrs;
to = getaddrs.addrs;
list_for_each(pos, &bp->address_list) {
from = list_entry(pos,
struct sctp_sockaddr_entry,
......
......@@ -232,7 +232,7 @@ static int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
return -EINVAL;
}
if (put_user((*(int *)(table->data) * 1000) / HZ,
(int *)oldval) ||
(int __user *)oldval) ||
(oldlenp && put_user(sizeof (int), oldlenp)))
return -EFAULT;
}
......@@ -242,7 +242,7 @@ static int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
if (newlen != sizeof (int))
return -EINVAL;
if (get_user(new, (int *)newval))
if (get_user(new, (int __user *)newval))
return -EFAULT;
*(int *)(table->data) = (new * HZ) / 1000;
......
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