Skip to content

Commit a60822b

Browse files
longlimsftliuw
authored andcommitted
Drivers: hv: Use kzalloc for panic page allocation
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>
1 parent 0315fef commit a60822b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/hv/hv_common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ static void hv_kmsg_dump_unregister(void)
272272
atomic_notifier_chain_unregister(&panic_notifier_list,
273273
&hyperv_panic_report_block);
274274

275-
hv_free_hyperv_page(hv_panic_page);
275+
kfree(hv_panic_page);
276276
hv_panic_page = NULL;
277277
}
278278

279279
static void hv_kmsg_dump_register(void)
280280
{
281281
int ret;
282282

283-
hv_panic_page = hv_alloc_hyperv_zeroed_page();
283+
hv_panic_page = kzalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
284284
if (!hv_panic_page) {
285285
pr_err("Hyper-V: panic message page memory allocation failed\n");
286286
return;
@@ -289,7 +289,7 @@ static void hv_kmsg_dump_register(void)
289289
ret = kmsg_dump_register(&hv_kmsg_dumper);
290290
if (ret) {
291291
pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret);
292-
hv_free_hyperv_page(hv_panic_page);
292+
kfree(hv_panic_page);
293293
hv_panic_page = NULL;
294294
}
295295
}

0 commit comments

Comments
 (0)