aboutsummaryrefslogtreecommitdiffstats
path: root/src/boot.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-06-13 21:24:14 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-06-13 21:24:14 -0400
commit030a58a05e595694dccfa958563103d2f0644231 (patch)
tree3cb4e135ded7235f2edbbfc12db8764bd47221e7 /src/boot.c
parent7507ce28f436fe8b37bcd09a85c7289bf4c4284f (diff)
downloadseabios-030a58a05e595694dccfa958563103d2f0644231.tar.gz
Another fix for hlist_for_each_entry_safe.
Although the previous patch does fix hlist_for_each_entry_safe for the common case, it doesn't work correctly when deleting the current node. To fix this, introduce two macros - hlist_for_each_entry_safe for iterating through a list that can be modified, and hlist_for_each_entry_pprev for those users that only need access to the "pprev" pointer. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/boot.c')
-rw-r--r--src/boot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boot.c b/src/boot.c
index 6286e3cd..2fce315c 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -324,7 +324,7 @@ bootentry_add(int type, int prio, u32 data, const char *desc)
// Add entry in sorted order.
struct hlist_node **pprev;
struct bootentry_s *pos;
- hlist_for_each_entry_safe(pos, pprev, &BootList, node) {
+ hlist_for_each_entry_pprev(pos, pprev, &BootList, node) {
if (be->priority < pos->priority)
break;
if (be->priority > pos->priority)