git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
net
/
bluetooth
/
sco.c
diff --git
a/net/bluetooth/sco.c
b/net/bluetooth/sco.c
index
7714a2e
..
6b61323
100644
(file)
--- a/
net/bluetooth/sco.c
+++ b/
net/bluetooth/sco.c
@@
-24,6
+24,7
@@
/* Bluetooth SCO sockets. */
/* Bluetooth SCO sockets. */
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/types.h>
@@
-108,14
+109,17
@@
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;
static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
{
struct hci_dev *hdev = hcon->hdev;
- struct sco_conn *conn
= hcon->sco_data
;
+ struct sco_conn *conn;
- if (
conn || status
)
+ if (
(conn = hcon->sco_data)
)
return conn;
return conn;
- conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC);
- if (!conn)
+ if (status)
+ return conn;
+
+ if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC)))
return NULL;
return NULL;
+ memset(conn, 0, sizeof(struct sco_conn));
spin_lock_init(&conn->lock);
spin_lock_init(&conn->lock);
@@
-131,7
+135,6
@@
static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
conn->mtu = 60;
BT_DBG("hcon %p conn %p", hcon, conn);
conn->mtu = 60;
BT_DBG("hcon %p conn %p", hcon, conn);
-
return conn;
}
return conn;
}
@@
-252,7
+255,7
@@
static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
}
if ((err = hci_send_sco(conn->hcon, skb)) < 0)
}
if ((err = hci_send_sco(conn->hcon, skb)) < 0)
-
return err
;
+
goto fail
;
return count;
return count;
@@
-967,7
+970,7
@@
static int __init sco_init(void)
goto error;
}
goto error;
}
- class_create_file(bt_class, &class_attr_sco);
+ class_create_file(
&
bt_class, &class_attr_sco);
BT_INFO("SCO (Voice Link) ver %s", VERSION);
BT_INFO("SCO socket layer initialized");
BT_INFO("SCO (Voice Link) ver %s", VERSION);
BT_INFO("SCO socket layer initialized");
@@
-981,7
+984,7
@@
error:
static void __exit sco_exit(void)
{
static void __exit sco_exit(void)
{
- class_remove_file(bt_class, &class_attr_sco);
+ class_remove_file(
&
bt_class, &class_attr_sco);
if (bt_sock_unregister(BTPROTO_SCO) < 0)
BT_ERR("SCO socket unregistration failed");
if (bt_sock_unregister(BTPROTO_SCO) < 0)
BT_ERR("SCO socket unregistration failed");