2015-06-26 06:27:55

by An, Tedd

[permalink] [raw]
Subject: [PATCH] Bluetooth: hidp: Initialize list header of hidp sesson user

From: Tedd Ho-Jeong An <[email protected]>

When new hidp session is created, list header in l2cap_user is
not initialized and this causes list_empty() to fail in
l2cap_register_user() even if l2cap_user list is empty.

Signed-off-by: Tedd Ho-Jeong An <[email protected]>
---
net/bluetooth/hidp/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 9070dfd..f1a117f 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr,
session->conn = l2cap_conn_get(conn);
session->user.probe = hidp_session_probe;
session->user.remove = hidp_session_remove;
+ INIT_LIST_HEAD(&session->user.list);
session->ctrl_sock = ctrl_sock;
session->intr_sock = intr_sock;
skb_queue_head_init(&session->ctrl_transmit);
--
2.1.0


2015-06-26 07:06:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hidp: Initialize list header of hidp sesson user

Hi Tedd,

> When new hidp session is created, list header in l2cap_user is
> not initialized and this causes list_empty() to fail in
> l2cap_register_user() even if l2cap_user list is empty.
>
> Signed-off-by: Tedd Ho-Jeong An <[email protected]>
> ---
> net/bluetooth/hidp/core.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel