aboutsummaryrefslogtreecommitdiffstats
path: root/net/econet/af_econet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/econet/af_econet.c')
-rw-r--r--net/econet/af_econet.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 0e0254fd767d..29b4931aae52 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -457,15 +457,15 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
457 iov[0].iov_len = size; 457 iov[0].iov_len = size;
458 for (i = 0; i < msg->msg_iovlen; i++) { 458 for (i = 0; i < msg->msg_iovlen; i++) {
459 void __user *base = msg->msg_iov[i].iov_base; 459 void __user *base = msg->msg_iov[i].iov_base;
460 size_t len = msg->msg_iov[i].iov_len; 460 size_t iov_len = msg->msg_iov[i].iov_len;
461 /* Check it now since we switch to KERNEL_DS later. */ 461 /* Check it now since we switch to KERNEL_DS later. */
462 if (!access_ok(VERIFY_READ, base, len)) { 462 if (!access_ok(VERIFY_READ, base, iov_len)) {
463 mutex_unlock(&econet_mutex); 463 mutex_unlock(&econet_mutex);
464 return -EFAULT; 464 return -EFAULT;
465 } 465 }
466 iov[i+1].iov_base = base; 466 iov[i+1].iov_base = base;
467 iov[i+1].iov_len = len; 467 iov[i+1].iov_len = iov_len;
468 size += len; 468 size += iov_len;
469 } 469 }
470 470
471 /* Get a skbuff (no data, just holds our cb information) */ 471 /* Get a skbuff (no data, just holds our cb information) */
@@ -605,13 +605,14 @@ static struct proto econet_proto = {
605 * Create an Econet socket 605 * Create an Econet socket
606 */ 606 */
607 607
608static int econet_create(struct net *net, struct socket *sock, int protocol) 608static int econet_create(struct net *net, struct socket *sock, int protocol,
609 int kern)
609{ 610{
610 struct sock *sk; 611 struct sock *sk;
611 struct econet_sock *eo; 612 struct econet_sock *eo;
612 int err; 613 int err;
613 614
614 if (net != &init_net) 615 if (!net_eq(net, &init_net))
615 return -EAFNOSUPPORT; 616 return -EAFNOSUPPORT;
616 617
617 /* Econet only provides datagram services. */ 618 /* Econet only provides datagram services. */
@@ -742,7 +743,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg
742 return 0; 743 return 0;
743} 744}
744 745
745static struct net_proto_family econet_family_ops = { 746static const struct net_proto_family econet_family_ops = {
746 .family = PF_ECONET, 747 .family = PF_ECONET,
747 .create = econet_create, 748 .create = econet_create,
748 .owner = THIS_MODULE, 749 .owner = THIS_MODULE,