Commit 58c0cfa3 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Marcel Holtmann

[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.
parent 3e101acb
...@@ -164,11 +164,11 @@ static int cmtp_sock_create(struct socket *sock, int protocol) ...@@ -164,11 +164,11 @@ static int cmtp_sock_create(struct socket *sock, int protocol)
if (sock->type != SOCK_RAW) if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT; return -ESOCKTNOSUPPORT;
sock->ops = &cmtp_sock_ops;
if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL))) if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
sk_set_owner(sk, THIS_MODULE);
sock->ops = &cmtp_sock_ops; sock->ops = &cmtp_sock_ops;
sock->state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED;
...@@ -180,8 +180,9 @@ static int cmtp_sock_create(struct socket *sock, int protocol) ...@@ -180,8 +180,9 @@ static int cmtp_sock_create(struct socket *sock, int protocol)
} }
static struct net_proto_family cmtp_sock_family_ops = { static struct net_proto_family cmtp_sock_family_ops = {
.family = PF_BLUETOOTH, .family = PF_BLUETOOTH,
.create = cmtp_sock_create .owner = THIS_MODULE,
.create = cmtp_sock_create
}; };
int cmtp_init_sockets(void) int cmtp_init_sockets(void)
......
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