aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/avs/messages.c
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2022-07-07 14:41:45 +0200
committerMark Brown <broonie@kernel.org>2022-07-08 18:53:20 +0100
commit3c1923a119a61534f8ce221766041ddf470c9307 (patch)
tree8cc5e0c9face9df2cb3a208e93511e6d2a28d0f4 /sound/soc/intel/avs/messages.c
parentASoC: Intel: avs: Relax DSP core transition timings (diff)
downloadlinux-dev-3c1923a119a61534f8ce221766041ddf470c9307.tar.xz
linux-dev-3c1923a119a61534f8ce221766041ddf470c9307.zip
ASoC: Intel: avs: Copy only as many RX bytes as necessary
There is no need to copy number of bytes specified by IPC message caller if DSP firmware returned lower number. In consequence, LARGE_CONFIG_GET handler is simplified. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r--sound/soc/intel/avs/messages.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/intel/avs/messages.c b/sound/soc/intel/avs/messages.c
index 6404fce8cde4..3559fb496e0b 100644
--- a/sound/soc/intel/avs/messages.c
+++ b/sound/soc/intel/avs/messages.c
@@ -378,7 +378,6 @@ int avs_ipc_get_large_config(struct avs_dev *adev, u16 module_id, u8 instance_id
union avs_module_msg msg = AVS_MODULE_REQUEST(LARGE_CONFIG_GET);
struct avs_ipc_msg request;
struct avs_ipc_msg reply = {{0}};
- size_t size;
void *buf;
int ret;
@@ -406,15 +405,14 @@ int avs_ipc_get_large_config(struct avs_dev *adev, u16 module_id, u8 instance_id
return ret;
}
- size = reply.rsp.ext.large_config.data_off_size;
- buf = krealloc(reply.data, size, GFP_KERNEL);
+ buf = krealloc(reply.data, reply.size, GFP_KERNEL);
if (!buf) {
kfree(reply.data);
return -ENOMEM;
}
*reply_data = buf;
- *reply_size = size;
+ *reply_size = reply.size;
return 0;
}