Thread (104 messages) 104 messages, 3 authors, 2012-05-30

Re: [PATCHv2 19/19] Bluetooth: A2MP: Manage incoming connections

From: Andrei Emeltchenko <hidden>
Date: 2012-05-24 11:43:13

Hi Mat,

On Wed, May 23, 2012 at 04:30:39PM -0700, Mat Martineau wrote:
quoted
+struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
+				       struct sk_buff *skb)
+{
+	struct amp_mgr *mgr;
+
+	mgr = amp_mgr_create(conn);
+
+	BT_DBG("mgr: %p chan %p", mgr, mgr->a2mp_chan);
+
+	return mgr->a2mp_chan;
mgr can be NULL.
...
quoted
chan = l2cap_get_chan_by_scid(conn, cid);
if (!chan) {
-		BT_DBG("unknown cid 0x%4.4x", cid);
-		/* Drop packet and return */
-		kfree_skb(skb);
-		return 0;
+		if (cid == L2CAP_CID_A2MP) {
+			chan = a2mp_channel_create(conn, skb);
If amp_mgr_create returned NULL, then you would have to handle NULL
from a2mp_channel_create too.
I've taken all comment in my v3 patch series.

Best regards 
Andrei Emeltchenko 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help