]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/netlink/af_netlink.c
net: proc: change proc_net_fops_create to proc_create
[mirror_ubuntu-artful-kernel.git] / net / netlink / af_netlink.c
index c8a1eb6eca2dea3597ba9c96a01b84656bad5700..50084c40a129c97ed3289a89c620ee51cdf5f5a6 100644 (file)
@@ -669,6 +669,9 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,
        struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr;
        int err;
 
+       if (addr_len < sizeof(struct sockaddr_nl))
+               return -EINVAL;
+
        if (nladdr->nl_family != AF_NETLINK)
                return -EINVAL;
 
@@ -2059,7 +2062,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
                struct sock *s = v;
                struct netlink_sock *nlk = nlk_sk(s);
 
-               seq_printf(seq, "%pK %-3d %-6d %08x %-8d %-8d %pK %-8d %-8d %-8lu\n",
+               seq_printf(seq, "%pK %-3d %-6u %08x %-8d %-8d %pK %-8d %-8d %-8lu\n",
                           s,
                           s->sk_protocol,
                           nlk->portid,
@@ -2142,7 +2145,7 @@ static const struct net_proto_family netlink_family_ops = {
 static int __net_init netlink_net_init(struct net *net)
 {
 #ifdef CONFIG_PROC_FS
-       if (!proc_net_fops_create(net, "netlink", 0, &netlink_seq_fops))
+       if (!proc_create("netlink", 0, net->proc_net, &netlink_seq_fops))
                return -ENOMEM;
 #endif
        return 0;
@@ -2182,7 +2185,6 @@ static struct pernet_operations __net_initdata netlink_net_ops = {
 
 static int __init netlink_proto_init(void)
 {
-       struct sk_buff *dummy_skb;
        int i;
        unsigned long limit;
        unsigned int order;
@@ -2191,7 +2193,7 @@ static int __init netlink_proto_init(void)
        if (err != 0)
                goto out;
 
-       BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb));
+       BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > FIELD_SIZEOF(struct sk_buff, cb));
 
        nl_table = kcalloc(MAX_LINKS, sizeof(*nl_table), GFP_KERNEL);
        if (!nl_table)