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)
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)
......
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