mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-10 06:34:17 +08:00
ASoC: SOF: loader: Adjust validation condition for fw_offset
Condition in if statement should be same as trace message and FW size equal to zero (after skipping offset) should be marked as invalid. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200520165911.21696-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
29c859df7b
commit
523773b9ea
@ -293,7 +293,7 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
|
||||
|
||||
chip_info = desc->chip_info;
|
||||
|
||||
if (plat_data->fw->size < plat_data->fw_offset) {
|
||||
if (plat_data->fw->size <= plat_data->fw_offset) {
|
||||
dev_err(sdev->dev, "error: firmware size must be greater than firmware offset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ static int check_header(struct snd_sof_dev *sdev, const struct firmware *fw,
|
||||
struct snd_sof_fw_header *header;
|
||||
size_t fw_size = fw->size - fw_offset;
|
||||
|
||||
if (fw->size < fw_offset) {
|
||||
if (fw->size <= fw_offset) {
|
||||
dev_err(sdev->dev, "error: firmware size must be greater than firmware offset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user