Skip to content

Commit 70b3d56

Browse files
author
Jyri Sarha
committed
modules: Use list_for_item() instead of list_for_item_safe() in mod_free()
Use list_for_item() instead of list_for_item_safe() in mod_free(). There is no need for *_safe() version when loop is not continued after an element is removed from the list. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent a5cafd8 commit 70b3d56

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/audio/module_adapter/module/generic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,13 @@ int mod_free(struct processing_module *mod, const void *ptr)
351351
struct module_resources *res = &mod->priv.resources;
352352
struct module_resource *container;
353353
struct list_item *res_list;
354-
struct list_item *_res_list;
355354

356355
MEM_API_CHECK_THREAD(res);
357356
if (!ptr)
358357
return 0;
359358

360359
/* Find which container keeps this memory */
361-
list_for_item_safe(res_list, _res_list, &res->res_list) {
360+
list_for_item(res_list, &res->res_list) {
362361
container = container_of(res_list, struct module_resource, list);
363362
if (container->ptr == ptr) {
364363
int ret = free_contents(mod, container);

0 commit comments

Comments
 (0)