aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/cmtp
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-12-02 18:26:25 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-12-02 18:26:25 -0500
commit5c69b0ada634bca4111fcc332df5fad2447ec90f (patch)
treed54e608075292c97e54bfd182ceef061aa3fc7df /net/bluetooth/cmtp
parentce7e4ad1436a0139c16225f2376134cff3ad24fe (diff)
parent33cb722c22f28964a501a56cc76397834c221c7a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
Diffstat (limited to 'net/bluetooth/cmtp')
-rw-r--r--net/bluetooth/cmtp/core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index 9e8940b24bba..6c9c1fd601ca 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -65,14 +65,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr)
65 65
66static void __cmtp_link_session(struct cmtp_session *session) 66static void __cmtp_link_session(struct cmtp_session *session)
67{ 67{
68 __module_get(THIS_MODULE);
69 list_add(&session->list, &cmtp_session_list); 68 list_add(&session->list, &cmtp_session_list);
70} 69}
71 70
72static void __cmtp_unlink_session(struct cmtp_session *session) 71static void __cmtp_unlink_session(struct cmtp_session *session)
73{ 72{
74 list_del(&session->list); 73 list_del(&session->list);
75 module_put(THIS_MODULE);
76} 74}
77 75
78static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) 76static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci)
@@ -325,6 +323,7 @@ static int cmtp_session(void *arg)
325 up_write(&cmtp_session_sem); 323 up_write(&cmtp_session_sem);
326 324
327 kfree(session); 325 kfree(session);
326 module_put_and_exit(0);
328 return 0; 327 return 0;
329} 328}
330 329
@@ -374,9 +373,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
374 373
375 __cmtp_link_session(session); 374 __cmtp_link_session(session);
376 375
376 __module_get(THIS_MODULE);
377 session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", 377 session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d",
378 session->num); 378 session->num);
379 if (IS_ERR(session->task)) { 379 if (IS_ERR(session->task)) {
380 module_put(THIS_MODULE);
380 err = PTR_ERR(session->task); 381 err = PTR_ERR(session->task);
381 goto unlink; 382 goto unlink;
382 } 383 }