diff options
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 85defccc0287..7714a2ec3854 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -108,17 +108,14 @@ static void sco_sock_init_timer(struct sock *sk) | |||
108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | 108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) |
109 | { | 109 | { |
110 | struct hci_dev *hdev = hcon->hdev; | 110 | struct hci_dev *hdev = hcon->hdev; |
111 | struct sco_conn *conn; | 111 | struct sco_conn *conn = hcon->sco_data; |
112 | |||
113 | if ((conn = hcon->sco_data)) | ||
114 | return conn; | ||
115 | 112 | ||
116 | if (status) | 113 | if (conn || status) |
117 | return conn; | 114 | return conn; |
118 | 115 | ||
119 | if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC))) | 116 | conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC); |
117 | if (!conn) | ||
120 | return NULL; | 118 | return NULL; |
121 | memset(conn, 0, sizeof(struct sco_conn)); | ||
122 | 119 | ||
123 | spin_lock_init(&conn->lock); | 120 | spin_lock_init(&conn->lock); |
124 | 121 | ||
@@ -134,6 +131,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | |||
134 | conn->mtu = 60; | 131 | conn->mtu = 60; |
135 | 132 | ||
136 | BT_DBG("hcon %p conn %p", hcon, conn); | 133 | BT_DBG("hcon %p conn %p", hcon, conn); |
134 | |||
137 | return conn; | 135 | return conn; |
138 | } | 136 | } |
139 | 137 | ||