mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 18:07:03 +00:00
soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free
list_for_each_entry_safe() is necessary if list objects are deleted from the list while traversing it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
This commit is contained in:
parent
39179cb5b7
commit
148bb0439a
@ -1306,14 +1306,14 @@ static void knav_free_queue_ranges(struct knav_device *kdev)
|
||||
static void knav_queue_free_regions(struct knav_device *kdev)
|
||||
{
|
||||
struct knav_region *region;
|
||||
struct knav_pool *pool;
|
||||
struct knav_pool *pool, *tmp;
|
||||
unsigned size;
|
||||
|
||||
for (;;) {
|
||||
region = first_region(kdev);
|
||||
if (!region)
|
||||
break;
|
||||
list_for_each_entry(pool, ®ion->pools, region_inst)
|
||||
list_for_each_entry_safe(pool, tmp, ®ion->pools, region_inst)
|
||||
knav_pool_destroy(pool);
|
||||
|
||||
size = region->virt_end - region->virt_start;
|
||||
|
Loading…
Reference in New Issue
Block a user