Skip to content

Commit 1a0ce0a

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: catpt: Fix offset checks
Verify if the entire block is found within DRAM, not just the start of it. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20251126095523.3925364-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5d0cad4 commit 1a0ce0a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sound/soc/intel/catpt/loader.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int catpt_restore_memdumps(struct catpt_dev *cdev, struct dma_chan *chan)
216216
continue;
217217

218218
off = catpt_to_host_offset(info->offset);
219-
if (off < cdev->dram.start || off > cdev->dram.end)
219+
if (off < cdev->dram.start || off + info->size >= cdev->dram.end)
220220
continue;
221221

222222
dev_dbg(cdev->dev, "restoring memdump: off 0x%08x size %d\n",
@@ -261,12 +261,12 @@ static int catpt_restore_fwimage(struct catpt_dev *cdev,
261261
continue;
262262

263263
off = catpt_to_host_offset(info->offset);
264-
if (off < cdev->dram.start || off > cdev->dram.end)
265-
continue;
266-
267264
r2.start = off;
268265
r2.end = r2.start + info->size - 1;
269266

267+
if (r2.start < cdev->dram.start || r2.end > cdev->dram.end)
268+
continue;
269+
270270
if (!resource_intersection(&r2, &r1, &common))
271271
continue;
272272
/* calculate start offset of common data area */

0 commit comments

Comments
 (0)