]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: bnep: Fix module reference
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 19 Nov 2011 12:23:33 +0000 (13:23 +0100)
committerGustavo F. Padovan <padovan@profusion.mobi>
Mon, 21 Nov 2011 16:29:25 +0000 (14:29 -0200)
commit6fbf4f355df621be6d1b795ae26a3d3a548a42e2
tree21c1476a90ad3214a2ffc6cdfbc94941e64bf427
parent1eadd418a985e5da629052035a59099d41402997
Bluetooth: bnep: Fix module reference

We cannot call module_put(THIS_MODULE) if this is our last reference. Otherwise,
this call may cleanup our module before it returns.

Gladly, the kthread API provides a simple wrapper for us. So lets use
module_put_and_exit() to avoid a race condition with the module cleanup code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/bnep/core.c