Commit c4956823 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds
Browse files

dmapools: protect page_list walk in show_pools()

show_pools() walks the page_list of a pool w/o protection against the list
modifications in alloc/free.  Take pool->lock to avoid stomping into

Signed-off-by: default avatarThomas Gleixner <>
Signed-off-by: default avatarMatthew Wilcox <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4d6c13f8
......@@ -86,10 +86,12 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf)
unsigned pages = 0;
unsigned blocks = 0;
list_for_each_entry(page, &pool->page_list, page_list) {
blocks += page->in_use;
/* per-pool info, no real statistics yet */
temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n",
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment