8000 Fix mistake: alloc (& free) 2^3, not 2^5 pages; thanks to @brian-wood! · ymm238/Linux-Kernel-Programming@917124c · GitHub
[go: up one dir, main page]

Skip to content

Commit 917124c

Browse files
committed
Fix mistake: alloc (& free) 2^3, not 2^5 pages; thanks to @brian-wood!
1 parent 86fa21f commit 917124c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ch8/lowlevel_mem/lowlevel_mem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ static int bsa_alloc(void)
120120
" (struct page addr=%pK (%px))\n",
121121
OURMODNAME, (void *)gptr4, (void *)gptr4, pg_ptr1, pg_ptr1);
122122

123-
/* 5. Allocate and init 2^5 = 32 pages with the alloc_pages() API.
123+
/* 5. Allocate and init 2^3 = 8 pages with the alloc_pages() API.
124124
* < Same warning as above applies here too! >
125125
*/
126-
gptr5 = page_address(alloc_pages(GFP_KERNEL, 5));
126+
gptr5 = page_address(alloc_pages(GFP_KERNEL, 3));
127127
if (!gptr5)
128128
goto out5;
129129
pr_info("%s: 5. alloc_pages() alloc'ed %lld pages from the BSA @ %pK (%px)\n",
130-
OURMODNAME, powerof(2, 5), (void *)gptr5, (void *)gptr5);
130+
OURMODNAME, powerof(2, 3), (void *)gptr5, (void *)gptr5);
131131

132132
return 0;
133133
out5:

0 commit comments

Comments
 (0)
0