Thread (2 messages) read the whole thread 2 messages, 2 authors, 2011-02-27
STALE5632d

[PATCH] Bluetooth: l2cap: fix a NULL pointer oops in l2cap_conn_start

From: Feng Tang <hidden>
Date: 2011-02-22 08:03:24
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

When I try to setup a PAND connection between the sever and client,
the server side always get a NULL pointer oops in l2cap_conn_start()
right after the client run "pand -r PANU -c sever_addr". Don't have
the boot log as it's an immediate hang.

Simply adding this "if (parent)" check will fix it, don't know whether
it fix the real problem. Anyway, send it as a hint.

Signed-off-by: Feng Tang <redacted>
---
 net/bluetooth/l2cap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 675614e..150366f 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -583,8 +583,9 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
 					struct sock *parent = bt_sk(sk)->parent;
 					rsp.result = cpu_to_le16(L2CAP_CR_PEND);
 					rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);
-					parent->sk_data_ready(parent, 0);
 
+					if (parent)
+						parent->sk_data_ready(parent, 0);
 				} else {
 					sk->sk_state = BT_CONFIG;
 					rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help