Merge tag 'armsoc-arm64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[deliverable/linux.git] / tools / vm / page-types.c
index dab61c377f54f5222199431f52d7a0f528a95f17..e92903fc71138fc71bb0697b2926d0cebd3d56b9 100644 (file)
@@ -633,7 +633,15 @@ static void walk_pfn(unsigned long voffset,
        unsigned long pages;
        unsigned long i;
 
-       memset(cgi, 0, sizeof cgi);
+       /*
+        * kpagecgroup_read() reads only if kpagecgroup were opened, but
+        * /proc/kpagecgroup might even not exist, so it's better to fill
+        * them with zeros here.
+        */
+       if (count == 1)
+               cgi[0] = 0;
+       else
+               memset(cgi, 0, sizeof cgi);
 
        while (count) {
                batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH);
This page took 0.059161 seconds and 5 git commands to generate.