alistair23-linux/drivers/soundwire
Pierre-Louis Bossart 6073755886 soundwire: fix port_ready[] dynamic allocation in mipi_disco
The existing code allocates memory for the total number of ports.
This only works if the ports are contiguous, but will break if e.g. a
Devices uses port0, 1, and 14. The port_ready[] array would contain 3
elements, which would lead to an out-of-bounds access. Conversely in
other cases, the wrong port index would be used leading to timeouts on
prepare.

This can be fixed by allocating for the worst-case of 15
ports (DP0..DP14). In addition since the number is now fixed, we can
use an array instead of a dynamic allocation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200831134318.11443-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-09-03 16:02:29 +05:30
..
bus.c soundwire: bus: initialize bus clock base and scale registers 2020-06-30 21:26:17 +05:30
bus.h soundwire: add Slave sysfs support 2020-05-20 17:22:41 +05:30
bus_type.c soundwire: extend SDW_SLAVE_ENTRY 2020-06-30 21:26:17 +05:30
cadence_master.c soundwire: intel/cadence: merge Soundwire interrupt handlers/threads 2020-07-21 16:05:41 +05:30
cadence_master.h soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming 2020-08-18 12:01:05 +05:30
debugfs.c soundwire: debugfs: clarify SDPX license with GPL-2.0-only 2020-05-05 08:51:44 +05:30
intel.c soundwire: intel: fix intel_suspend/resume defined but not used warning 2020-08-26 14:16:22 +05:30
intel.h soundwire: intel: add CLK_STOP_TEARDOWN for pm_runtime suspend 2020-08-18 12:01:05 +05:30
intel_init.c soundwire: intel_init: handle power rail dependencies for clock stop mode 2020-08-18 12:01:05 +05:30
Kconfig soundwire: qcom: add support for SoundWire controller 2020-01-14 11:57:47 +05:30
Makefile soundwire: Replace 'objs' by 'y' 2020-06-22 17:06:08 +05:30
master.c soundwire: master: enable pm runtime 2020-08-17 12:04:48 +05:30
mipi_disco.c soundwire: fix port_ready[] dynamic allocation in mipi_disco 2020-09-03 16:02:29 +05:30
qcom.c soundwire: qcom: Constify static structs 2020-06-22 17:28:10 +05:30
slave.c soundwire: fix port_ready[] dynamic allocation in mipi_disco 2020-09-03 16:02:29 +05:30
stream.c soundwire: fix the kernel-doc comment 2020-07-16 09:37:43 +05:30
sysfs_local.h soundwire: add Slave sysfs support 2020-05-20 17:22:41 +05:30
sysfs_slave.c soundwire: fix trailing line in sysfs_slave.c 2020-05-20 17:27:45 +05:30
sysfs_slave_dpn.c soundwire: fix spelling mistake 2020-05-20 17:29:37 +05:30