Skip to content

Commit ddcaf3c

Browse files
sunilmutgregkh
authored andcommitted
Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer
The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. This fixes it. Fixes: 81b18bc ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2d8bc61 commit ddcaf3c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,13 +1047,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,
10471047
* Write dump contents to the page. No need to synchronize; panic should
10481048
* be single-threaded.
10491049
*/
1050-
if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page,
1051-
PAGE_SIZE, &bytes_written)) {
1052-
pr_err("Hyper-V: Unable to get kmsg data for panic\n");
1053-
return;
1054-
}
1055-
1056-
hyperv_report_panic_msg(panic_pa, bytes_written);
1050+
kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE,
1051+
&bytes_written);
1052+
if (bytes_written)
1053+
hyperv_report_panic_msg(panic_pa, bytes_written);
10571054
}
10581055

10591056
static struct kmsg_dumper hv_kmsg_dumper = {

0 commit comments

Comments
 (0)