mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
kpagecount: add slab page checking because _mapcount is in a union
Add a PageSlab() check before adding the _mapcount value to /kpagecount. page->_mapcount is in a union with the SLAB structure so for pages controlled by SLAB, page_mapcount() returns nonsense. Signed-off-by: Petr Holasek <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Matt Mackall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c6a3405846
commit
a6fc86d2b4
1 changed files with 1 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
|
|||
ppage = pfn_to_page(pfn);
|
||||
else
|
||||
ppage = NULL;
|
||||
if (!ppage)
|
||||
if (!ppage || PageSlab(ppage))
|
||||
pcount = 0;
|
||||
else
|
||||
pcount = page_mapcount(ppage);
|
||||
|
|
|
|||
Loading…
Reference in a new issue