Skip to content

Commit

Permalink
Drivers: hv: vmus: Fix the check for return value from kmsg get dump …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
sunilmut authored and gregkh committed Jul 29, 2018
1 parent 2d8bc61 commit ddcaf3c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,13 +1047,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,
* Write dump contents to the page. No need to synchronize; panic should
* be single-threaded.
*/
if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page,
PAGE_SIZE, &bytes_written)) {
pr_err("Hyper-V: Unable to get kmsg data for panic\n");
return;
}

hyperv_report_panic_msg(panic_pa, bytes_written);
kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE,
&bytes_written);
if (bytes_written)
hyperv_report_panic_msg(panic_pa, bytes_written);
}

static struct kmsg_dumper hv_kmsg_dumper = {
Expand Down

0 comments on commit ddcaf3c

Please sign in to comment.