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
static struct device bt3c_device = {
.bus_id = "pcmcia",
.kobj = {
.k_name = "bt3c"
}
};
......
......@@ -33,7 +33,6 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
......
......@@ -480,15 +480,16 @@ struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
s->mtu = RFCOMM_DEFAULT_MTU;
s->cfc = RFCOMM_CFC_UNKNOWN;
/* Do not increment module usage count for listening sessions.
* Otherwise we won't be able to unload the module. */
if (state != BT_LISTEN)
if (!try_module_get(THIS_MODULE)) {
kfree(s);
return NULL;
}
list_add(&s->list, &session_list);
/* Do not increment module usage count for listeting sessions.
* 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)
__module_get(THIS_MODULE);
return s;
}
......
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