diff options
| author | Alex Elder <elder@linaro.org> | 2018-04-27 09:08:17 -0500 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-12-24 00:46:39 -0800 |
| commit | 88dbbebc3f2ce3b2baeb679c22af86865f84ad1f (patch) | |
| tree | ad7f1cc83582c6f1fb48ae5411af2b56296666d1 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 51a767ab43a83682ac33f4bf3a3dbbf1cbb85fb9 (diff) | |
soc: qcom: qmi: fix a buffer sizing bug
In qmi_handle_init(), a buffer is allocated for to hold messages
received through the handle's socket. Any "normal" messages
(expected by the caller) will have a header prepended, so the
buffer size is adjusted to accomodate that.
The buffer must also be of sufficient size to receive control
messages, so the size is increased if necessary to ensure these
will fit.
Unfortunately the calculation is done wrong, making it possible
for the calculated buffer size to be too small to hold a "normal"
message. Specifically, if:
recv_buf_size > sizeof(struct qrtr_ctrl_pkt) - sizeof(struct qmi_header)
AND
recv_buf_size < sizeof(struct qrtr_ctrl_pkt)
the current logic will use sizeof(struct qrtr_ctrl_pkt) as the
receive buffer size, which is not enough to hold the maximum
"normal" message plus its header. Currently this problem occurs
for (13 < recv_buf_size < 20).
This patch corrects this.
Change-Id: If80199f06bbf0de0b0f06358cdd7dc215c6d6fb7
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Git-repo: https://android.googlesource.com/kernel/msm
Git-commit: 7df5ff258bd27900d516fea88da10d05602bf8c7
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
