Skip to content

Commit da8fd82

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390: make setup_randomness work
Commit bcfcbb6 ("s390: add system information as device randomness") intended to add some virtual machine specific information to the randomness pool. Unfortunately it uses the page allocator before it is ready to use. In result the page allocator always returns NULL and the setup_randomness function never adds anything to the randomness pool. To fix this use memblock_alloc and memblock_free instead. Fixes: bcfcbb6 ("s390: add system information as device randomness") Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent f83435c commit da8fd82

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎arch/s390/kernel/setup.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,10 +822,10 @@ static void __init setup_randomness(void)
822822
{
823823
struct sysinfo_3_2_2 *vmms;
824824

825-
vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL);
826-
if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count)
825+
vmms = (struct sysinfo_3_2_2 *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
826+
if (stsi(vmms, 3, 2, 2) == 0 && vmms->count)
827827
add_device_randomness(&vmms, vmms->count);
828-
free_page((unsigned long) vmms);
828+
memblock_free((unsigned long) vmms, PAGE_SIZE);
829829
}
830830

831831
/*

0 commit comments

Comments
 (0)