core.c (05668381140309088443bf5dc53add4104610fbb) | core.c (25ea6db04a96d7871e7ece27d566f3228d59d932) |
---|---|
1/* 2 CMTP implementation for Linux Bluetooth stack (BlueZ). 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License version 2 as 7 published by the Free Software Foundation; 8 --- 321 unchanged lines hidden (view full) --- 330 bdaddr_t src, dst; 331 int i, err; 332 333 BT_DBG(""); 334 335 baswap(&src, &bt_sk(sock->sk)->src); 336 baswap(&dst, &bt_sk(sock->sk)->dst); 337 | 1/* 2 CMTP implementation for Linux Bluetooth stack (BlueZ). 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License version 2 as 7 published by the Free Software Foundation; 8 --- 321 unchanged lines hidden (view full) --- 330 bdaddr_t src, dst; 331 int i, err; 332 333 BT_DBG(""); 334 335 baswap(&src, &bt_sk(sock->sk)->src); 336 baswap(&dst, &bt_sk(sock->sk)->dst); 337 |
338 session = kmalloc(sizeof(struct cmtp_session), GFP_KERNEL); | 338 session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL); |
339 if (!session) 340 return -ENOMEM; | 339 if (!session) 340 return -ENOMEM; |
341 memset(session, 0, sizeof(struct cmtp_session)); | |
342 343 down_write(&cmtp_session_sem); 344 345 s = __cmtp_get_session(&bt_sk(sock->sk)->dst); 346 if (s && s->state == BT_CONNECTED) { 347 err = -EEXIST; 348 goto failed; 349 } --- 151 unchanged lines hidden --- | 341 342 down_write(&cmtp_session_sem); 343 344 s = __cmtp_get_session(&bt_sk(sock->sk)->dst); 345 if (s && s->state == BT_CONNECTED) { 346 err = -EEXIST; 347 goto failed; 348 } --- 151 unchanged lines hidden --- |