[PATCH 2/8] shared/hfp: Fix setting result pending flag

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

 



Let's set result_pending flag only when we are waiting for result from
upper layer. It will be used in following patch.
---
 src/shared/hfp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/shared/hfp.c b/src/shared/hfp.c
index 7ad6e42..3b61759 100644
--- a/src/shared/hfp.c
+++ b/src/shared/hfp.c
@@ -505,13 +505,13 @@ static void process_input(struct hfp_gw *hfp)
 		*ptr = '\0';
 	}
 
-	hfp->result_pending = true;
-
 	if (!call_prefix_handler(hfp, str)) {
-		if (hfp->command_callback)
+		if (hfp->command_callback) {
 			hfp->command_callback(str, hfp->command_data);
-		else
+			hfp->result_pending = true;
+		} else {
 			hfp_gw_send_result(hfp, HFP_RESULT_ERROR);
+		}
 	}
 
 	len = ringbuf_drain(hfp->read_buf, count + 1);
-- 
1.8.4

--
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