diff options
author | Steve Schrock <steve.schrock@getcruise.com> | 2024-03-19 16:06:39 +0000 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-03-19 11:45:23 -0500 |
commit | 32f570c95930c73e5a426cf45483728cffa04e66 (patch) | |
tree | 48761c0672b1451e8d13c48ddb0ffbbe087795b1 | |
parent | a703d1cc8e7edb4c3310b81f179936b547e06fdf (diff) | |
download | ofono-32f570c95930c73e5a426cf45483728cffa04e66.tar.gz |
qmi: Initialize group_id for control requests
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")
-rw-r--r-- | drivers/qmimodem/qmi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c index b92bcfa03..7f91b57d1 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; |