linux/drivers/soc
Alex Elder 7df5ff258b 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.

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>
2018-05-25 15:53:58 -05:00
..
actions soc: actions: sps: Add S700 2017-11-27 23:11:01 +01:00
amlogic amlogic: meson-gx-socinfo: Update soc ids 2018-03-19 16:40:26 -07:00
atmel drivers: soc: atmel: Add basic support for new sama5d2 SiPs 2017-09-17 19:45:59 +02:00
bcm soc: bcm: brcmstb: Be multi-platform compatible 2018-01-15 15:47:07 +01:00
dove License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsl soc/fsl/qbman: fix issue in qman_delete_cgr_safe() 2018-03-14 13:16:23 -04:00
gemini soc: Add SoC driver for Gemini 2018-01-04 17:01:53 +01:00
imx i.MX drivers update for 4.17: 2018-03-15 16:23:33 +01:00
lantiq MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd 2017-09-04 21:19:02 +02:00
mediatek soc: mediatek: update power domain data of MT2712 2018-03-19 02:29:05 +01:00
qcom soc: qcom: qmi: fix a buffer sizing bug 2018-05-25 15:53:58 -05:00
renesas soc: renesas: rcar-rst: Add support for R-Car M3-N 2018-02-23 15:55:01 +01:00
rockchip soc: rockchip: power-domain: Add a sanity check on pd->num_clks 2018-03-05 19:42:29 +01:00
samsung The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
sunxi drivers: soc: sunxi: add support for A64 and its SRAM C 2017-08-18 14:30:21 +08:00
tegra soc/tegra: pmc: Use the new reset APIs to manage reset controllers 2018-03-19 09:42:39 +01:00
ti soc: ti: Add pm33xx driver for basic suspend support 2018-02-27 08:53:46 -08:00
ux500
versatile soc: versatile: remove unnecessary static in realview_soc_probe() 2017-08-16 22:28:27 +02:00
xilinx soc: xilinx: Fix Kconfig alignment 2018-01-16 15:50:21 +01:00
zte soc: zte: Restrict SOC_ZTE to ARCH_ZX or COMPILE_TEST 2017-07-27 13:12:34 +02:00
Kconfig soc: xilinx: Create folder structure for soc specific drivers 2018-01-08 13:42:39 +01:00
Makefile soc: Unconditionally include qcom Makefile 2018-05-25 15:53:57 -05:00