diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2022-10-25 16:27:06 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-26 14:18:33 +0100 |
commit | 5cab0d6c2bd1272287068943471102dc6a0c4bcc (patch) | |
tree | 62d29d84db0923273821c9f61a76ed6e966577b0 /sound/soc/sof/ipc4-loader.c | |
parent | 514bc59bfcd02a7f241dad91b5534faffb7effd6 (diff) | |
download | lwn-5cab0d6c2bd1272287068943471102dc6a0c4bcc.tar.gz lwn-5cab0d6c2bd1272287068943471102dc6a0c4bcc.zip |
ASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()
sof_ipc4_fw_parse_ext_man() can return negative error numbers which is not
correct for the used size_t type.
Change the return value to ssize_t and use the same type where the function
is called.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 73c091a2fe96 ("ASoC: SOF: ipc4-loader: Support for loading external libraries")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221025132706.30356-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc4-loader.c')
-rw-r--r-- | sound/soc/sof/ipc4-loader.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c index af0018b38cf0..702196774c50 100644 --- a/sound/soc/sof/ipc4-loader.c +++ b/sound/soc/sof/ipc4-loader.c @@ -17,8 +17,8 @@ /* The module ID includes the id of the library it is part of at offset 12 */ #define SOF_IPC4_MOD_LIB_ID_SHIFT 12 -static size_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev, - struct sof_ipc4_fw_library *fw_lib) +static ssize_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev, + struct sof_ipc4_fw_library *fw_lib) { struct sof_ipc4_fw_data *ipc4_data = sdev->private; const struct firmware *fw = fw_lib->sof_fw.fw; @@ -141,7 +141,7 @@ static size_t sof_ipc4_fw_parse_basefw_ext_man(struct snd_sof_dev *sdev) { struct sof_ipc4_fw_data *ipc4_data = sdev->private; struct sof_ipc4_fw_library *fw_lib; - size_t payload_offset; + ssize_t payload_offset; int ret; fw_lib = devm_kzalloc(sdev->dev, sizeof(*fw_lib), GFP_KERNEL); @@ -170,7 +170,7 @@ static int sof_ipc4_load_library_by_uuid(struct snd_sof_dev *sdev, struct sof_ipc4_fw_data *ipc4_data = sdev->private; struct sof_ipc4_fw_library *fw_lib; const char *fw_filename; - size_t payload_offset; + ssize_t payload_offset; int ret, i, err; if (!sdev->pdata->fw_lib_prefix) { |