aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@nokia.com>2011-01-11 17:20:20 +0200
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-08 01:40:08 -0200
commit5a08eccedaa1e12b74cf3afea9e11a9aefc29f73 (patch)
tree9bc0f14ce8785a32cf1d4cf4ebf1c297312fada8 /net/bluetooth/hci_core.c
parent17fa4b9dff72fb3a1a68cc80caf98fc941d2b8b3 (diff)
downloadkernel_samsung_smdk4412-5a08eccedaa1e12b74cf3afea9e11a9aefc29f73.zip
kernel_samsung_smdk4412-5a08eccedaa1e12b74cf3afea9e11a9aefc29f73.tar.gz
kernel_samsung_smdk4412-5a08eccedaa1e12b74cf3afea9e11a9aefc29f73.tar.bz2
Bluetooth: Do not use assignments in IF conditions
Fix checkpatch warnings concerning assignments in if conditions. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index bf6729a..2f00322 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -429,7 +429,8 @@ int hci_inquiry(void __user *arg)
if (copy_from_user(&ir, ptr, sizeof(ir)))
return -EFAULT;
- if (!(hdev = hci_dev_get(ir.dev_id)))
+ hdev = hci_dev_get(ir.dev_id);
+ if (!hdev)
return -ENODEV;
hci_dev_lock_bh(hdev);
@@ -489,7 +490,8 @@ int hci_dev_open(__u16 dev)
struct hci_dev *hdev;
int ret = 0;
- if (!(hdev = hci_dev_get(dev)))
+ hdev = hci_dev_get(dev);
+ if (!hdev)
return -ENODEV;
BT_DBG("%s %p", hdev->name, hdev);
@@ -1940,7 +1942,11 @@ static void hci_cmd_task(unsigned long arg)
}
/* Send queued commands */
- if (atomic_read(&hdev->cmd_cnt) && (skb = skb_dequeue(&hdev->cmd_q))) {
+ if (atomic_read(&hdev->cmd_cnt)) {
+ skb = skb_dequeue(&hdev->cmd_q);
+ if (!skb)
+ return;
+
kfree_skb(hdev->sent_cmd);
hdev->sent_cmd = skb_clone(skb, GFP_ATOMIC);