diff mbox series

qmi: Initialize group_id for control requests

Message ID 20240319160639.42456-1-steve.schrock@getcruise.com (mailing list archive)
State Accepted
Commit 32f570c95930c73e5a426cf45483728cffa04e66
Headers show
Series qmi: Initialize group_id for control requests | expand

Commit Message

Steve Schrock March 19, 2024, 4:06 p.m. UTC
valgrind found that for control requests, the group_id was not being
set. The requests are being allocated using l_malloc which does not
initialize memory to 0, unlike l_new. The impact is that cleanup of
the requests during service closure or modem shutdown might
incorrectly remove a control request from the queue. The fix is to
always initialize this field to 0.

Fixes: 0a4591e439ba ("qmi: Add an abstract group id to services and requests")
---
 drivers/qmimodem/qmi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

patchwork-bot+ofono@kernel.org March 19, 2024, 4:50 p.m. UTC | #1
Hello:

This patch was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

On Tue, 19 Mar 2024 16:06:39 +0000 you wrote:
> valgrind found that for control requests, the group_id was not being
> set. The requests are being allocated using l_malloc which does not
> initialize memory to 0, unlike l_new. The impact is that cleanup of
> the requests during service closure or modem shutdown might
> incorrectly remove a control request from the queue. The fix is to
> always initialize this field to 0.
> 
> [...]

Here is the summary with links:
  - qmi: Initialize group_id for control requests
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=32f570c95930

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index b92bcfa0368e..7f91b57d15be 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -238,6 +238,7 @@  static struct qmi_request *__request_alloc(uint32_t service_type,
 	msglen = hdrlen + QMI_MESSAGE_HDR_SIZE + length;
 	req = l_malloc(sizeof(struct qmi_request) + msglen);
 	req->tid = 0;
+	req->group_id = 0;
 	req->len = msglen;
 	req->client = client;