aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-07-06 09:40:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-07-12 18:34:28 -0400
commit25ea6db04a96d7871e7ece27d566f3228d59d932 (patch)
tree12d0b6735a451111c8b45ebb9523caac9578d0fc /net/bluetooth/sco.c
parentc2ce920468624d87ec5f91f080ea99681dae6d88 (diff)
[Bluetooth] Remaining transitions to use kzalloc()
This patch makes the remaining transitions to use kzalloc(). Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r--net/bluetooth/sco.c12
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)
108static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) 108static 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