From: Nick Pelly Date: Thu, 8 Apr 2010 23:23:32 +0000 (-0700) Subject: Bluetooth: Hack: Don't dereference null pointer. X-Git-Tag: firefly_0821_release~9833^2~5^2~216 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a43d3f835fa20875980d0a363f1543725d6dc55c;p=firefly-linux-kernel-4.4.55.git Bluetooth: Hack: Don't dereference null pointer. This avoids the S305 panic during incoming connection. S305 sends PSM 25 L2CAP connection request before the L2CAP info response. When we receive that info response we crash on null pointer here. Bug: 2127637 Change-Id: Ib637516251f46fa9a9c87ac015dc2f27df5a27fd Signed-off-by: Nick Pelly --- diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 0ac962b978e1..72337ad07eca 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -570,7 +570,8 @@ 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;