adapter: Fix not using the correct setting
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 4 Mar 2021 22:17:40 +0000 (14:17 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
set_mode shall use opcode to identify what setting are being changed
rather then the mode.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/adapter.c

index f8a17cb..08c6ed4 100644 (file)
@@ -1066,7 +1066,7 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
        memset(&cp, 0, sizeof(cp));
        cp.val = mode;
 
-       switch (mode) {
+       switch (opcode) {
        case MGMT_OP_SET_POWERED:
                setting = MGMT_SETTING_POWERED;
                break;