mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added the safe version of the list_for_each function.
This commit is contained in:
parent
db53ac9b41
commit
6ea4260c1c
6 changed files with 35 additions and 28 deletions
|
|
@ -54,8 +54,8 @@ int bag_add(bag_t *bag, void *ptr)
|
|||
|
||||
int bag_del(bag_t *bag, void *ptr)
|
||||
{
|
||||
struct list_head *pos, *next;
|
||||
list_for_each(pos, next, bag) {
|
||||
struct list_head *pos;
|
||||
list_for_each(pos, bag) {
|
||||
bag1_t *b = list_entry(pos, bag1_t, list);
|
||||
if (b->ptr == ptr) {
|
||||
list_del(&b->list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue