ASoC: Intel: Common: Fix NULL dereference in tx_wait_done

rx_data and rx_bytes present for tx_wait_done are optional parameters.
If not provided, function should not attempt to copy received data.
This change fixes memcpy NULL pointer dereference issue occurring when
optional rx_data is NULL while received message size is non-zero.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Cezary Rojewski 2019-06-13 21:04:34 +02:00 committed by Mark Brown
parent 26ae204908
commit 9f4f42d710
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ static int tx_wait_done(struct sst_generic_ipc *ipc,
} else {
/* copy the data returned from DSP */
if (msg->rx_size)
if (rx_data)
memcpy(rx_data, msg->rx_data, msg->rx_size);
ret = msg->errno;
}