The list_for_each_entry macro does not work for lists that have only
one item in it. Thus, we need a special case for lists containing only
one entry.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
if (af->pid) {
if (!pf->ml)
return;
+ if (list_empty(&pf->ml->list)) {
+ ml = list_to_maps_list(&pf->ml->list);
+ if (ml->map->pid == af->pid)
+ goto get_stats;
+ }
list_for_each_entry(ml, &pf->ml->list, list) {
if (ml->map->pid == af->pid)
goto get_stats;
struct maps *map;
struct list_head list;
};
+#define list_to_maps_list(list_head) \
+ container_of((list_head), struct maps_list, list)
struct pageframe {
struct bintree tree;