Skip to content

Commit

Permalink
ASoC: SOF: Fix probe point getter
Browse files Browse the repository at this point in the history
Firmware API changes which introduced 'num_elems' param in several probe
structs such as sof_ipc_probe_dma_add_params also impacted getter for
both, DMA and probe points. All struct handlers except for
sof_ipc_probe_info_params have been updated. Align said handler too to
calculate payload size correctly.

Fixes: f3b433e ("ASoC: SOF: Implement Probe IPC API")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200309142124.29262-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Cezary Rojewski authored and Mark Brown committed Mar 10, 2020
1 parent 62f9ed5 commit a3b7343
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/soc/sof/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ static int sof_ipc_probe_info(struct snd_sof_dev *sdev, unsigned int cmd,
if (!reply->num_elems)
goto exit;

bytes = reply->num_elems * sizeof(reply->dma[0]);
if (cmd == SOF_IPC_PROBE_DMA_INFO)
bytes = sizeof(reply->dma[0]);
else
bytes = sizeof(reply->desc[0]);
bytes *= reply->num_elems;
*params = kmemdup(&reply->dma[0], bytes, GFP_KERNEL);
if (!*params) {
ret = -ENOMEM;
goto exit;
}
*num_params = msg.num_elems;
*num_params = reply->num_elems;

exit:
kfree(reply);
Expand Down

0 comments on commit a3b7343

Please sign in to comment.