diff options
author | Karol Trzcinski <karolx.trzcinski@linux.intel.com> | 2020-05-20 19:59:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-25 16:59:33 +0300 |
commit | 523773b9ea9f430810332aa117ea48f8feafce9a (patch) | |
tree | 4c4f6fd941464d175e025e215df8d44006397a9a /sound/soc/sof/loader.c | |
parent | 29c859df7b52080f0809b8a0b9d7b86fff379ef9 (diff) | |
download | linux-523773b9ea9f430810332aa117ea48f8feafce9a.tar.xz |
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>
Diffstat (limited to 'sound/soc/sof/loader.c')
-rw-r--r-- | sound/soc/sof/loader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c index 4a5b57ecf359..eed3d1e65685 100644 --- a/sound/soc/sof/loader.c +++ b/sound/soc/sof/loader.c @@ -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; } |