Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291016
b: refs/heads/master
c: c03b355
h: refs/heads/master
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Johan Hedberg committed Feb 23, 2012
1 parent 90c83ae commit 475cf01
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3df91ea20e744344100b10ae69a17211fcf5b207
refs/heads/master: c03b355ea2938495bbdf25a4645be545be8890f4
11 changes: 11 additions & 0 deletions trunk/include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ struct l2cap_chan {

void *data;
struct l2cap_ops *ops;
struct mutex lock;
};

struct l2cap_ops {
Expand Down Expand Up @@ -609,6 +610,16 @@ static inline void l2cap_chan_put(struct l2cap_chan *c)
kfree(c);
}

static inline void l2cap_chan_lock(struct l2cap_chan *chan)
{
mutex_lock(&chan->lock);
}

static inline void l2cap_chan_unlock(struct l2cap_chan *chan)
{
mutex_unlock(&chan->lock);
}

static inline void l2cap_set_timer(struct l2cap_chan *chan,
struct delayed_work *work, long timeout)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ struct l2cap_chan *l2cap_chan_create(struct sock *sk)
if (!chan)
return NULL;

mutex_init(&chan->lock);

chan->sk = sk;

write_lock(&chan_list_lock);
Expand Down

0 comments on commit 475cf01

Please sign in to comment.