mm: Fix __dump_page when mapping->host is not set
Subsystems (2)
PATCH v2 1/1 mm: Fix __dump_page when mapping->host is not set
Swap mapping->host is NULL, so let us protect __dump_page() for such cases.
Fixes 1c6fb1d89e73c ("mm: print more information about mapping in __dump_page")
Signed-off-by Oscar Salvador <[email protected]>
Acked-by Michal Hocko <[email protected]>
--- mm/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/debug.c +1 -1
@@ -79,7 +79,7 @@ void __dump_page(struct page *page, const char *reason)pr_warn ("ksm " ); else if (mapping) {pr_warn ("%ps " , mapping->a_ops); -if (mapping->host->i_dentry.first) { +if (mapping->host && mapping->host->i_dentry.first) {struct dentry *dentry; dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias);pr_warn ("name:\"%pd\" " , dentry);
Signature · 1 line
2.13.7
Quoted 1 line · Oscar Salvador
Swap
mapping->hostis NULL, so let us protect__dump_page()for such cases.
Thanks :)
Quoted 4 lines
Fixes 1c6fb1d89e73c ("mm: print more information about mapping in __dump_page")Signed-off-by Oscar Salvador <[email protected]>Acked-by Michal Hocko <[email protected]>
Quoted 19 lines
--- mm/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/debug.c +1
-1@@ -79,7 +79,7 @@ void __dump_page(struct page *page, const char *reason)pr_warn ("ksm " ); else if (mapping) {pr_warn ("%ps " , mapping->a_ops); -if (mapping->host->i_dentry.first) { +if (mapping->host && mapping->host->i_dentry.first) {struct dentry *dentry; dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias);pr_warn ("name:\"%pd\" " , dentry);Signature · 1 line
2.13.7