]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Drivers: hv: Use kzalloc for panic page allocation
authorLong Li <longli@microsoft.com>
Tue, 6 May 2025 00:56:36 +0000 (17:56 -0700)
committerWei Liu <wei.liu@kernel.org>
Fri, 23 May 2025 16:30:56 +0000 (16:30 +0000)
To prepare for removal of hv_alloc_* and hv_free* functions, use
kzalloc/kfree directly for panic reporting page.

Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1746492997-4599-5-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1746492997-4599-5-git-send-email-longli@linuxonhyperv.com>

drivers/hv/hv_common.c

index f8e4330bd4c7ec7e5f0ed9baf41968fd722dfdd0..95c2497ffcffbf8474bd683b05fbf8483b01b847 100644 (file)
@@ -272,7 +272,7 @@ static void hv_kmsg_dump_unregister(void)
        atomic_notifier_chain_unregister(&panic_notifier_list,
                                         &hyperv_panic_report_block);
 
-       hv_free_hyperv_page(hv_panic_page);
+       kfree(hv_panic_page);
        hv_panic_page = NULL;
 }
 
@@ -280,7 +280,7 @@ static void hv_kmsg_dump_register(void)
 {
        int ret;
 
-       hv_panic_page = hv_alloc_hyperv_zeroed_page();
+       hv_panic_page = kzalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
        if (!hv_panic_page) {
                pr_err("Hyper-V: panic message page memory allocation failed\n");
                return;
@@ -289,7 +289,7 @@ static void hv_kmsg_dump_register(void)
        ret = kmsg_dump_register(&hv_kmsg_dumper);
        if (ret) {
                pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret);
-               hv_free_hyperv_page(hv_panic_page);
+               kfree(hv_panic_page);
                hv_panic_page = NULL;
        }
 }