Added the safe version of the list_for_each function.

This commit is contained in:
Jaroslav Kysela 2001-02-13 12:53:19 +00:00
parent db53ac9b41
commit 6ea4260c1c
6 changed files with 35 additions and 28 deletions

View file

@ -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);