Commit 8fc64470 authored by David S. Miller's avatar David S. Miller

Merge http://linux-mh.bkbits.net/bluetooth-2.6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents c72113b5 ca09bcc9
...@@ -491,6 +491,9 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long ...@@ -491,6 +491,9 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
static struct device bt3c_device = { static struct device bt3c_device = {
.bus_id = "pcmcia", .bus_id = "pcmcia",
.kobj = {
.k_name = "bt3c"
}
}; };
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h> #include <linux/sched.h>
......
...@@ -470,32 +470,33 @@ struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) ...@@ -470,32 +470,33 @@ struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
if (!s) if (!s)
return NULL; return NULL;
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));
BT_DBG("session %p sock %p", s, sock); BT_DBG("session %p sock %p", s, sock);
INIT_LIST_HEAD(&s->dlcs); INIT_LIST_HEAD(&s->dlcs);
s->state = state; s->state = state;
s->sock = sock; s->sock = sock;
s->mtu = RFCOMM_DEFAULT_MTU; s->mtu = RFCOMM_DEFAULT_MTU;
s->cfc = RFCOMM_CFC_UNKNOWN; s->cfc = RFCOMM_CFC_UNKNOWN;
list_add(&s->list, &session_list);
/* Do not increment module usage count for listeting sessions. /* Do not increment module usage count for listening sessions.
* Otherwise we won't be able to unload the module. * Otherwise we won't be able to unload the module. */
* Non listening session are added either by a socket or a TTYs
* which means that we already hold refcount to this module.
*/
if (state != BT_LISTEN) if (state != BT_LISTEN)
__module_get(THIS_MODULE); if (!try_module_get(THIS_MODULE)) {
kfree(s);
return NULL;
}
list_add(&s->list, &session_list);
return s; return s;
} }
void rfcomm_session_del(struct rfcomm_session *s) void rfcomm_session_del(struct rfcomm_session *s)
{ {
int state = s->state; int state = s->state;
BT_DBG("session %p state %ld", s, s->state); BT_DBG("session %p state %ld", s, s->state);
list_del(&s->list); list_del(&s->list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment