* [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size
@ 2010-07-09 19:38 Gustavo F. Padovan
2010-07-09 19:38 ` [PATCH 2/2] Bluetooth: Keep code under column 80 Gustavo F. Padovan
2010-07-09 20:46 ` [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Marcel Holtmann
0 siblings, 2 replies; 4+ messages in thread
From: Gustavo F. Padovan @ 2010-07-09 19:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Gustavo F. Padovan
From: Gustavo F. Padovan <padovan@profusion.mobi>
Probably a typo error. We were using the wrong struct to get size.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
net/bluetooth/l2cap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index e366be0..419e2c3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -530,7 +530,7 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
conn->feat_mask)
&& l2cap_pi(sk)->conf_state &
L2CAP_CONF_STATE2_DEVICE) {
- tmp1 = kzalloc(sizeof(struct srej_list),
+ tmp1 = kzalloc(sizeof(struct sock_del_list),
GFP_ATOMIC);
tmp1->sk = sk;
list_add_tail(&tmp1->list, &del.list);
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Bluetooth: Keep code under column 80
2010-07-09 19:38 [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Gustavo F. Padovan
@ 2010-07-09 19:38 ` Gustavo F. Padovan
2010-07-09 20:46 ` Marcel Holtmann
2010-07-09 20:46 ` [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Marcel Holtmann
1 sibling, 1 reply; 4+ messages in thread
From: Gustavo F. Padovan @ 2010-07-09 19:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Gustavo F. Padovan
From: Gustavo F. Padovan <padovan@profusion.mobi>
Purely a cosmetic change, it doesn't change the code flow.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
net/bluetooth/l2cap.c | 48 ++++++++++++++++++++++++++----------------------
1 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 419e2c3..449cbdd 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -522,31 +522,35 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
}
if (sk->sk_state == BT_CONNECT) {
- if (l2cap_check_security(sk) &&
- __l2cap_no_conn_pending(sk)) {
- struct l2cap_conn_req req;
+ struct l2cap_conn_req req;
- if (!l2cap_mode_supported(l2cap_pi(sk)->mode,
- conn->feat_mask)
- && l2cap_pi(sk)->conf_state &
- L2CAP_CONF_STATE2_DEVICE) {
- tmp1 = kzalloc(sizeof(struct sock_del_list),
- GFP_ATOMIC);
- tmp1->sk = sk;
- list_add_tail(&tmp1->list, &del.list);
- bh_unlock_sock(sk);
- continue;
- }
+ if (!l2cap_check_security(sk) ||
+ !__l2cap_no_conn_pending(sk)) {
+ bh_unlock_sock(sk);
+ continue;
+ }
- req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
- req.psm = l2cap_pi(sk)->psm;
+ if (!l2cap_mode_supported(l2cap_pi(sk)->mode,
+ conn->feat_mask)
+ && l2cap_pi(sk)->conf_state &
+ L2CAP_CONF_STATE2_DEVICE) {
+ tmp1 = kzalloc(sizeof(struct sock_del_list),
+ GFP_ATOMIC);
+ tmp1->sk = sk;
+ list_add_tail(&tmp1->list, &del.list);
+ bh_unlock_sock(sk);
+ continue;
+ }
- l2cap_pi(sk)->ident = l2cap_get_ident(conn);
- l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
+ req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
+ req.psm = l2cap_pi(sk)->psm;
+
+ l2cap_pi(sk)->ident = l2cap_get_ident(conn);
+ l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
+
+ l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
+ L2CAP_CONN_REQ, sizeof(req), &req);
- l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
- L2CAP_CONN_REQ, sizeof(req), &req);
- }
} else if (sk->sk_state == BT_CONNECT2) {
struct l2cap_conn_rsp rsp;
char buf[128];
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size
2010-07-09 19:38 [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Gustavo F. Padovan
2010-07-09 19:38 ` [PATCH 2/2] Bluetooth: Keep code under column 80 Gustavo F. Padovan
@ 2010-07-09 20:46 ` Marcel Holtmann
1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2010-07-09 20:46 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth, Gustavo F. Padovan
Hi Gustavo,
> Probably a typo error. We were using the wrong struct to get size.
>
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
> net/bluetooth/l2cap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Bluetooth: Keep code under column 80
2010-07-09 19:38 ` [PATCH 2/2] Bluetooth: Keep code under column 80 Gustavo F. Padovan
@ 2010-07-09 20:46 ` Marcel Holtmann
0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2010-07-09 20:46 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth, Gustavo F. Padovan
Hi Gustavo,
> Purely a cosmetic change, it doesn't change the code flow.
>
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
> net/bluetooth/l2cap.c | 48 ++++++++++++++++++++++++++----------------------
> 1 files changed, 26 insertions(+), 22 deletions(-)
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-09 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-09 19:38 [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Gustavo F. Padovan
2010-07-09 19:38 ` [PATCH 2/2] Bluetooth: Keep code under column 80 Gustavo F. Padovan
2010-07-09 20:46 ` Marcel Holtmann
2010-07-09 20:46 ` [PATCH 1/2] Bluetooth: Fix bug in kzalloc allocation size Marcel Holtmann
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).