diff options
author | David S. Miller <davem@davemloft.net> | 2011-04-25 16:03:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-25 16:03:02 -0400 |
commit | bf734843120b905bacc3d24c88d7455ae70bf6e1 (patch) | |
tree | 280e72e3d33b90e302485875b82b520e13c89513 /net | |
parent | 345578d97c549995ddbcc178f16f710602cc06bb (diff) |
bluetooth: Fix use-before-initiailized var.
net/bluetooth/l2cap_core.c: In function ‘l2cap_recv_frame’:
net/bluetooth/l2cap_core.c:3612:15: warning: ‘sk’ may be used uninitialized in this function
net/bluetooth/l2cap_core.c:3612:15: note: ‘sk’ was declared here
Actually the problem is in the inline function l2cap_data_channel(), we
branch to the label 'done' which tests 'sk' before we set it to anything.
Initialize it to NULL to fix this.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index d47de2b04b2e..8cfa2a663028 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -3609,7 +3609,7 @@ drop: | |||
3609 | static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk_buff *skb) | 3609 | static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk_buff *skb) |
3610 | { | 3610 | { |
3611 | struct l2cap_chan *chan; | 3611 | struct l2cap_chan *chan; |
3612 | struct sock *sk; | 3612 | struct sock *sk = NULL; |
3613 | struct l2cap_pinfo *pi; | 3613 | struct l2cap_pinfo *pi; |
3614 | u16 control; | 3614 | u16 control; |
3615 | u8 tx_seq; | 3615 | u8 tx_seq; |