diff options
-rw-r--r-- | include/net/bluetooth/a2mp.h | 2 | ||||
-rw-r--r-- | net/bluetooth/a2mp.c | 4 | ||||
-rw-r--r-- | net/bluetooth/amp.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index e776ab2dc572..42f21766c538 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -133,7 +133,7 @@ struct a2mp_physlink_rsp { | |||
133 | extern struct list_head amp_mgr_list; | 133 | extern struct list_head amp_mgr_list; |
134 | extern struct mutex amp_mgr_list_lock; | 134 | extern struct mutex amp_mgr_list_lock; |
135 | 135 | ||
136 | void amp_mgr_get(struct amp_mgr *mgr); | 136 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); |
137 | int amp_mgr_put(struct amp_mgr *mgr); | 137 | int amp_mgr_put(struct amp_mgr *mgr); |
138 | u8 __next_ident(struct amp_mgr *mgr); | 138 | u8 __next_ident(struct amp_mgr *mgr); |
139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 7bf9a10d8e46..d5136cfb57e2 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -751,11 +751,13 @@ static struct l2cap_chan *a2mp_chan_open(struct l2cap_conn *conn, bool locked) | |||
751 | } | 751 | } |
752 | 752 | ||
753 | /* AMP Manager functions */ | 753 | /* AMP Manager functions */ |
754 | void amp_mgr_get(struct amp_mgr *mgr) | 754 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr) |
755 | { | 755 | { |
756 | BT_DBG("mgr %p orig refcnt %d", mgr, atomic_read(&mgr->kref.refcount)); | 756 | BT_DBG("mgr %p orig refcnt %d", mgr, atomic_read(&mgr->kref.refcount)); |
757 | 757 | ||
758 | kref_get(&mgr->kref); | 758 | kref_get(&mgr->kref); |
759 | |||
760 | return mgr; | ||
759 | } | 761 | } |
760 | 762 | ||
761 | static void amp_mgr_destroy(struct kref *kref) | 763 | static void amp_mgr_destroy(struct kref *kref) |
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c index 59da0f15818e..231d7ef53ecb 100644 --- a/net/bluetooth/amp.c +++ b/net/bluetooth/amp.c | |||
@@ -123,7 +123,7 @@ struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
123 | hcon->attempt++; | 123 | hcon->attempt++; |
124 | hcon->handle = __next_handle(mgr); | 124 | hcon->handle = __next_handle(mgr); |
125 | hcon->remote_id = remote_id; | 125 | hcon->remote_id = remote_id; |
126 | hcon->amp_mgr = mgr; | 126 | hcon->amp_mgr = amp_mgr_get(mgr); |
127 | hcon->out = out; | 127 | hcon->out = out; |
128 | 128 | ||
129 | return hcon; | 129 | return hcon; |