2004-10-06 21:33:13

by Stuart MacDonald

[permalink] [raw]
Subject: Problems in list.h macros?

I am referring to a stock 2.4.27's linux/list.h.

1: list_for_each(_entry)_safe() calls seem not to be as safe as they
are implied to be. They seem to be only actually safe *iff* a
list_del() is the only operation performed on the list entry. If pos
is freed after a list_del, aren't you toast? If n has its pointers
modified, say by a list_add() to a different list, don't you end up
at the new list instead of the original list? Shouldn't this be noted
in the macro comments?

..Stu