Bluetooth: Fix logic in hci_power_on().
If hci_dev_open() returns no error or EALREADY, allow the power on
sequence to proceed.
Signed-off-by: Inga Stotland <ingas@codeaurora.org>
Conflicts:
net/bluetooth/hci_core.c
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b47ae16..4353f9f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -961,10 +961,12 @@
static void hci_power_on(struct work_struct *work)
{
struct hci_dev *hdev = container_of(work, struct hci_dev, power_on);
+ int err;
BT_DBG("%s", hdev->name);
- if (hci_dev_open(hdev->id) < 0 && !test_bit(HCI_UP, &hdev->flags))
+ err = hci_dev_open(hdev->id);
+ if (err && err != -EALREADY)
return;
if (test_bit(HCI_AUTO_OFF, &hdev->flags) &&