Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276770
b: refs/heads/master
c: 9b338c3
h: refs/heads/master
v: v3
  • Loading branch information
David Herrmann authored and Gustavo F. Padovan committed Nov 21, 2011
1 parent 536bcf9 commit 573d691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48b28b8db9a74cc5c43e76485dc397e22bea2984
refs/heads/master: 9b338c3dd12918f7f7df2b882f63f71e9efbcb41
8 changes: 3 additions & 5 deletions trunk/net/bluetooth/bnep/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,12 @@ static struct bnep_session *__bnep_get_session(u8 *dst)

static void __bnep_link_session(struct bnep_session *s)
{
/* It's safe to call __module_get() here because sessions are added
by the socket layer which has to hold the reference to this module.
*/
__module_get(THIS_MODULE);
list_add(&s->list, &bnep_session_list);
}

static void __bnep_unlink_session(struct bnep_session *s)
{
list_del(&s->list);
module_put(THIS_MODULE);
}

static int bnep_send(struct bnep_session *s, void *data, size_t len)
Expand Down Expand Up @@ -530,6 +525,7 @@ static int bnep_session(void *arg)

up_write(&bnep_session_sem);
free_netdev(dev);
module_put_and_exit(0);
return 0;
}

Expand Down Expand Up @@ -616,9 +612,11 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)

__bnep_link_session(s);

__module_get(THIS_MODULE);
s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name);
if (IS_ERR(s->task)) {
/* Session thread start failed, gotta cleanup. */
module_put(THIS_MODULE);
unregister_netdev(dev);
__bnep_unlink_session(s);
err = PTR_ERR(s->task);
Expand Down

0 comments on commit 573d691

Please sign in to comment.