summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2012-05-21 18:30:35 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:09:19 -0700
commit794fa47369dbc7670cef5dc6c3d9057ccc0797a6 (patch)
tree85612ab88224edad8845d501c689b03e7bed2016 /net/bluetooth
parent3ec7cb458d11eb9e5afd1e71a863a09165e98889 (diff)
net: bluetooth: check if workqueue handle is valid before use
Change-Id: Ia93a3489669ec762cdaf84c558672320da378e17 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 29297a1d9c1d..ddb320f6865d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2672,6 +2672,11 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen);
+ if (!hdev->workqueue) {
+ WARN_ON("hci_send_cmd: workqueue not initialised");
+ return -ENOMEM;
+ }
+
skb = hci_prepare_cmd(hdev, opcode, plen, param);
if (!skb) {
BT_ERR("%s no memory for command", hdev->name);