[PATCH 1/3] emulator: Verify Set Controller To Host Flow Control Command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return invalid parameters error if reserved value is used.
---
 emulator/btdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 2a0c673..a2a2e50 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -2393,8 +2393,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 
 	case BT_HCI_CMD_SET_HOST_FLOW_CONTROL:
 		shfc = data;
-		btdev->host_flow_control = shfc->enable;
-		status = BT_HCI_ERR_SUCCESS;
+		if (shfc->enable > 0x03) {
+			status = BT_HCI_ERR_INVALID_PARAMETERS;
+		} else {
+			btdev->host_flow_control = shfc->enable;
+			status = BT_HCI_ERR_SUCCESS;
+		}
 		cmd_complete(btdev, opcode, &status, sizeof(status));
 		break;
 
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux