X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=net%2Fbluetooth%2Fbnep%2Fsock.c;h=9ebd3c64474d916480506d20e2db8be6f1b30182;hb=6257ff2177ff02d7f260a7a501876aa41cb9a9f6;hp=5563db1bf526e94d4a48c5af511315c4d3646786;hpb=79acbb3ff2d8095b692e1502b9eb2ccec348de26;p=powerpc.git diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index 5563db1bf5..9ebd3c6447 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c @@ -1,4 +1,4 @@ -/* +/* BNEP implementation for Linux Bluetooth stack (BlueZ). Copyright (C) 2001-2002 Inventel Systemes Written 2001-2002 by @@ -14,19 +14,19 @@ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. */ /* * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $ - */ + */ #include @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -89,7 +88,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long if (copy_from_user(&ca, argp, sizeof(ca))) return -EFAULT; - + nsock = sockfd_lookup(ca.sock, &err); if (!nsock) return err; @@ -101,20 +100,20 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long err = bnep_add_connection(&ca, nsock); if (!err) { - if (copy_to_user(argp, &ca, sizeof(ca))) + if (copy_to_user(argp, &ca, sizeof(ca))) err = -EFAULT; } else fput(nsock->file); return err; - + case BNEPCONNDEL: if (!capable(CAP_NET_ADMIN)) return -EACCES; if (copy_from_user(&cd, argp, sizeof(cd))) return -EFAULT; - + return bnep_del_connection(&cd); case BNEPGETCONNLIST: @@ -123,7 +122,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long if (cl.cnum <= 0) return -EINVAL; - + err = bnep_get_connlist(&cl); if (!err && copy_to_user(argp, &cl, sizeof(cl))) return -EFAULT; @@ -163,7 +162,7 @@ static int bnep_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigne if (cl.cnum <= 0) return -EINVAL; - + err = bnep_get_connlist(&cl); if (!err && put_user(cl.cnum, (uint32_t __user *) arg)) @@ -205,7 +204,7 @@ static struct proto bnep_proto = { .obj_size = sizeof(struct bt_sock) }; -static int bnep_sock_create(struct socket *sock, int protocol) +static int bnep_sock_create(struct net *net, struct socket *sock, int protocol) { struct sock *sk; @@ -214,7 +213,7 @@ static int bnep_sock_create(struct socket *sock, int protocol) if (sock->type != SOCK_RAW) return -ESOCKTNOSUPPORT; - sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &bnep_proto, 1); + sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &bnep_proto); if (!sk) return -ENOMEM;