diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-12-06 14:59:32 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-06 14:59:32 -0500 |
commit | facda29d75a30a8ff4f1f23a48a368d167563843 (patch) | |
tree | 3f0b8e77cb826cd24e9f0b760b27467eda76907a /net/bluetooth/cmtp/core.c | |
parent | 9995ffe5f5fdddcc73e4465cc3f8b38714df8108 (diff) | |
parent | 33cb722c22f28964a501a56cc76397834c221c7a (diff) | |
download | talos-op-linux-facda29d75a30a8ff4f1f23a48a368d167563843.tar.gz talos-op-linux-facda29d75a30a8ff4f1f23a48a368d167563843.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
Diffstat (limited to 'net/bluetooth/cmtp/core.c')
-rw-r--r-- | net/bluetooth/cmtp/core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 7d00ddf9e9dc..5a6e634f7fca 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c @@ -67,14 +67,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr) static void __cmtp_link_session(struct cmtp_session *session) { - __module_get(THIS_MODULE); list_add(&session->list, &cmtp_session_list); } static void __cmtp_unlink_session(struct cmtp_session *session) { list_del(&session->list); - module_put(THIS_MODULE); } static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) @@ -327,6 +325,7 @@ static int cmtp_session(void *arg) up_write(&cmtp_session_sem); kfree(session); + module_put_and_exit(0); return 0; } @@ -376,9 +375,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) __cmtp_link_session(session); + __module_get(THIS_MODULE); session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", session->num); if (IS_ERR(session->task)) { + module_put(THIS_MODULE); err = PTR_ERR(session->task); goto unlink; } |