summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-01-13 05:39:42 +0100
committerMarcel Holtmann <holtmann@holtmann.org>2004-01-13 05:39:42 +0100
commit58c0cfa3ced9ad74b8b6a105dce4978fb9be1435 (patch)
tree064346542366e1d9b156eec29caabeca2b8e2136
parent3e101acb3c152e2fdb96468af050731d8962e7c5 (diff)
[Bluetooth] Fix CMTP reference counting
This patch fixes the module reference counting which was done wrong while porting this driver to the 2.6 kernel series.
-rw-r--r--net/bluetooth/cmtp/sock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 042ecd0b371f..fdb0eb6f8319 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -164,11 +164,11 @@ static int cmtp_sock_create(struct socket *sock, int protocol)
if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
- sock->ops = &cmtp_sock_ops;
-
if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL)))
return -ENOMEM;
+ sk_set_owner(sk, THIS_MODULE);
+
sock->ops = &cmtp_sock_ops;
sock->state = SS_UNCONNECTED;
@@ -180,8 +180,9 @@ static int cmtp_sock_create(struct socket *sock, int protocol)
}
static struct net_proto_family cmtp_sock_family_ops = {
- .family = PF_BLUETOOTH,
- .create = cmtp_sock_create
+ .family = PF_BLUETOOTH,
+ .owner = THIS_MODULE,
+ .create = cmtp_sock_create
};
int cmtp_init_sockets(void)