Commit 16ffbb7b authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Marcel Holtmann

[Bluetooth] Fix reference counting for incoming connections

The L2CAP reference counting must be increased by the RFCOMM module if an
incoming connection is accepted. If this is not done, it will be decreased
one time to often if the connection is terminated.
parent 71f644c0
...@@ -1650,6 +1650,8 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s) ...@@ -1650,6 +1650,8 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
nsock->type = sock->type; nsock->type = sock->type;
nsock->ops = sock->ops; nsock->ops = sock->ops;
__module_get(nsock->ops->owner);
err = sock->ops->accept(sock, nsock, O_NONBLOCK); err = sock->ops->accept(sock, nsock, O_NONBLOCK);
if (err < 0) { if (err < 0) {
sock_release(nsock); sock_release(nsock);
......
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