diff mbox series

qmi: Make sure to set transaction id as LE16

Message ID 20240227032552.123044-1-steve.schrock@getcruise.com (mailing list archive)
State Not Applicable, archived
Headers show
Series qmi: Make sure to set transaction id as LE16 | expand

Commit Message

Steve Schrock Feb. 27, 2024, 3:25 a.m. UTC
From: Denis Kenzior <denkenz@gmail.com>

Transaction identifier for QMI service messages was always read in as
LE16 value, however when allocating a request it was set in host byte
order.  Fix that.
---
 drivers/qmimodem/qmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index 2371f178..35751d7c 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -670,13 +670,13 @@  static uint16_t __request_submit(struct qmi_device *device,
 	struct qmi_service_hdr *hdr =
 		(struct qmi_service_hdr *) &req->data[QMI_MUX_HDR_SIZE];
 
-	hdr->type = 0x00;
-	hdr->transaction = device->next_service_tid++;
+	req->tid = device->next_service_tid++;
 
 	if (device->next_service_tid < 256)
 		device->next_service_tid = 256;
 
-	req->tid = hdr->transaction;
+	hdr->type = 0x00;
+	hdr->transaction = L_CPU_TO_LE16(req->tid);
 
 	l_queue_push_tail(device->req_queue, req);
 	wakeup_writer(device);