diff mbox series

[8/8] qmi: Make sure to set transaction id as LE16

Message ID 20240226153459.1463304-8-denkenz@gmail.com (mailing list archive)
State Accepted
Commit df0c32bda1865504c22841666e742d399499bf58
Headers show
Series [1/8] qmi: Use FAM instead of allocating a member | expand

Commit Message

Denis Kenzior Feb. 26, 2024, 3:34 p.m. UTC
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 2371f178a4c4..35751d7ce267 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);