Bluetooth: btmrvl: error path handling in setup handler
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 1 Jan 2015 08:13:40 +0000 (00:13 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 6 Jan 2015 15:19:35 +0000 (16:19 +0100)
If module init command fails, FW might not be in good state.
We will return from setup handler and skip downloading further
commands.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmrvl_main.c

index e3f5711..c435b58 100644 (file)
@@ -538,8 +538,11 @@ static int btmrvl_check_device_tree(struct btmrvl_private *priv)
 static int btmrvl_setup(struct hci_dev *hdev)
 {
        struct btmrvl_private *priv = hci_get_drvdata(hdev);
+       int ret;
 
-       btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
+       ret = btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
+       if (ret)
+               return ret;
 
        priv->btmrvl_dev.gpio_gap = 0xffff;