mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
[Bluetooth] Remaining transitions to use kzalloc()
This patch makes the remaining transitions to use kzalloc(). Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
c2ce920468
commit
25ea6db04a
7 changed files with 16 additions and 25 deletions
|
@ -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;
|
||||
struct sco_conn *conn = hcon->sco_data;
|
||||
|
||||
if ((conn = hcon->sco_data))
|
||||
if (conn || status)
|
||||
return conn;
|
||||
|
||||
if (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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue