[PATCH 46/60] Process received command in base to previous request sent

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

 



From: José Antonio Santos-Cadenas <santoscadenas@xxxxxxxxx>

---
 mcap/mcap.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/mcap/mcap.c b/mcap/mcap.c
index 18220bc..3f3268b 100644
--- a/mcap/mcap.c
+++ b/mcap/mcap.c
@@ -1254,6 +1254,12 @@ static gboolean check_err_rsp(struct mcap_mcl *mcl, uint8_t *cmd,
 	mcap4B_rsp *rsp;
 	char *msg;
 
+	if (cmd[0] == MCAP_ERROR_RSP) {
+		msg = "MCAP_ERROR_RSP received";
+		close = TRUE;
+		goto fail;
+	}
+
 	/* Check if the response matches with the last request */
 	if ((rlen < MIN_RSP_LEN) || ((mcl->lcmd[0] + 1) != cmd[0])) {
 		msg = "Protocol error";
@@ -1492,11 +1498,7 @@ static void proc_response(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
 	gboolean close;
 	RELEASE_TIMER(mcl);
 
-	switch (cmd[0]) {
-	case MCAP_ERROR_RSP:
-		error("MCAP_ERROR_RSP received");
-		close = TRUE;
-		break;
+	switch (mcl->lcmd[0] + 1) {
 	case MCAP_MD_CREATE_MDL_RSP:
 		close = process_md_create_mdl_rsp(mcl, cmd, len);
 		break;
-- 
1.6.3.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