summaryrefslogtreecommitdiff
path: root/src/pmm.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/pmm.c
parent7507ce28f436fe8b37bcd09a85c7289bf4c4284f (diff)
downloadqemu-seabios-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/pmm.c')
-rw-r--r--src/pmm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pmm.c b/src/pmm.c
index da97283..8f993fd 100644
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -86,7 +86,7 @@ addSpace(struct zone_s *zone, void *start, void *end)
// Find position to add space
struct allocinfo_s *info;
struct hlist_node **pprev;
- hlist_for_each_entry_safe(info, pprev, &zone->head, node) {
+ hlist_for_each_entry_pprev(info, pprev, &zone->head, node) {
if (info->data < start)
break;
}