diff options
| author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-03-23 03:42:15 -0400 |
|---|---|---|
| committer | Gustavo Padovan <gustavo@padovan.org> | 2012-03-28 11:02:39 -0400 |
| commit | 8d7e1c7f7e5f9fe8f6279752fc33fcb77afd5001 (patch) | |
| tree | 1fce3c7c9832a276399c47c407c2163f8d7dcbe6 | |
| parent | 94324962066231a938564bebad0f941cd2d06bb2 (diff) | |
Bluetooth: Fix memory leaks due to chan refcnt
When we queue delayed work we hold(chan) and delayed work
shall put(chan) after execution.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
| -rw-r--r-- | net/bluetooth/l2cap_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 3e450f4a3125..38d934a1124a 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
| @@ -1309,6 +1309,7 @@ static void l2cap_monitor_timeout(struct work_struct *work) | |||
| 1309 | if (chan->retry_count >= chan->remote_max_tx) { | 1309 | if (chan->retry_count >= chan->remote_max_tx) { |
| 1310 | l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED); | 1310 | l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED); |
| 1311 | l2cap_chan_unlock(chan); | 1311 | l2cap_chan_unlock(chan); |
| 1312 | l2cap_chan_put(chan); | ||
| 1312 | return; | 1313 | return; |
| 1313 | } | 1314 | } |
| 1314 | 1315 | ||
| @@ -1317,6 +1318,7 @@ static void l2cap_monitor_timeout(struct work_struct *work) | |||
| 1317 | 1318 | ||
| 1318 | l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_POLL); | 1319 | l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_POLL); |
| 1319 | l2cap_chan_unlock(chan); | 1320 | l2cap_chan_unlock(chan); |
| 1321 | l2cap_chan_put(chan); | ||
| 1320 | } | 1322 | } |
| 1321 | 1323 | ||
| 1322 | static void l2cap_retrans_timeout(struct work_struct *work) | 1324 | static void l2cap_retrans_timeout(struct work_struct *work) |
| @@ -1336,6 +1338,7 @@ static void l2cap_retrans_timeout(struct work_struct *work) | |||
| 1336 | l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_POLL); | 1338 | l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_POLL); |
| 1337 | 1339 | ||
| 1338 | l2cap_chan_unlock(chan); | 1340 | l2cap_chan_unlock(chan); |
| 1341 | l2cap_chan_put(chan); | ||
| 1339 | } | 1342 | } |
| 1340 | 1343 | ||
| 1341 | static void l2cap_drop_acked_frames(struct l2cap_chan *chan) | 1344 | static void l2cap_drop_acked_frames(struct l2cap_chan *chan) |
