linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: l2cap: fix a NULL pointer oops in l2cap_conn_start
@ 2011-02-22  8:03 Feng Tang
  2011-02-27 20:13 ` Gustavo F. Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Feng Tang @ 2011-02-22  8:03 UTC (permalink / raw)
  To: marcel, linux-bluetooth; +Cc: Feng Tang

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 <feng.tang@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: l2cap: fix a NULL pointer oops in l2cap_conn_start
  2011-02-22  8:03 [PATCH] Bluetooth: l2cap: fix a NULL pointer oops in l2cap_conn_start Feng Tang
@ 2011-02-27 20:13 ` Gustavo F. Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo F. Padovan @ 2011-02-27 20:13 UTC (permalink / raw)
  To: Feng Tang; +Cc: marcel, linux-bluetooth

Hi Feng,

* Feng Tang <feng.tang@intel.com> [2011-02-22 16:03:24 +0800]:

> 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.

I pushed a proper fix for this issues, see the bluetooth-2.6 tree.

-- 
Gustavo F. Padovan
http://profusion.mobi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-27 20:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22  8:03 [PATCH] Bluetooth: l2cap: fix a NULL pointer oops in l2cap_conn_start Feng Tang
2011-02-27 20:13 ` Gustavo F. Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).