Skip to content

Commit 6cd9b6c

Browse files
Jyri Sarhakv2019i
authored andcommitted
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 c8a8626 commit 6cd9b6c

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)