]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: ipc: check ipc return value before data copy
authorJaska Uimonen <jaska.uimonen@linux.intel.com>
Fri, 28 Feb 2020 23:18:48 +0000 (17:18 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 2 Mar 2020 14:13:48 +0000 (14:13 +0000)
commitd1ac211f9f27dcb152e0894dc86f3722836fdd0c
tree78638bc9d23a4f3d455bcae821c65f01d61ea482
parent48238ed9df8b38fafb34f342cc5542e8aaad8a8c
ASoC: SOF: ipc: check ipc return value before data copy

In tx_wait_done the ipc payload is copied before the DSP transaction
error code is checked. This might lead to corrupted data in kernel side
even though the error would be handled later. It is also pointless to
copy the data in case of error. So change the order of error check and
copy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c