From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Mon, 18 Feb 2019 10:37:03 +0100 Subject: [PATCH] ASoC: Intel: Common: Fix NULL dereference for 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. Change-Id: I881cf2f0990ef1e4786b7e340ad14d3cb35b33c1 Tracked-On: OAM-74942 Signed-off-by: Cezary Rojewski Reviewed-by: Slawinski, AmadeuszX Tested-by: gkblditp Reviewed-by: Lewandowski, Gustaw --- sound/soc/intel/common/sst-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c index 81b413e3b610..3465eca8ed1d 100644 --- a/sound/soc/intel/common/sst-ipc.c +++ b/sound/soc/intel/common/sst-ipc.c @@ -78,7 +78,7 @@ static int tx_wait_done(struct sst_generic_ipc *ipc, goto err; } - if (msg->rx_size) { + if (rx_data) { if (rx_bytes != NULL) *rx_bytes = msg->rx_size; memcpy(rx_data, msg->rx_data, msg->rx_size); -- https://clearlinux.org