diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-07-06 17:40:09 +0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-07-13 02:34:28 +0400 |
commit | 25ea6db04a96d7871e7ece27d566f3228d59d932 (patch) | |
tree | 12d0b6735a451111c8b45ebb9523caac9578d0fc /net/bluetooth/sco.c | |
parent | c2ce920468624d87ec5f91f080ea99681dae6d88 (diff) | |
download | linux-25ea6db04a96d7871e7ece27d566f3228d59d932.tar.xz |
[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.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) static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) { struct hci_dev *hdev = hcon->hdev; - struct sco_conn *conn; - - if ((conn = hcon->sco_data)) - return conn; + struct sco_conn *conn = hcon->sco_data; - if (status) + if (conn || status) return conn; - if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC))) + conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC); + if (!conn) return NULL; - memset(conn, 0, sizeof(struct sco_conn)); spin_lock_init(&conn->lock); @@ -134,6 +131,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) conn->mtu = 60; BT_DBG("hcon %p conn %p", hcon, conn); + return conn; } |