Skip to content

Commit

Permalink
KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_op…
Browse files Browse the repository at this point in the history
…s_kvmhv_nestedv2_config_fill_info()

The return value of kvmppc_gse_put_buff_info() is not assigned to 'rc' and
'rc' is uninitialized at this point.
So the error handling can not work.

Assign the expected value to 'rc' to fix the issue.

Fixes: 19d31c5 ("KVM: PPC: Add support for nestedv2 guests")
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Vaibhav Jain <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/a7ed4cc12e0a0bbd97fac44fe6c222d1c393ec95.1706441651.git.christophe.jaillet@wanadoo.fr
  • Loading branch information
tititiou36 authored and mpe committed May 7, 2024
1 parent 651d61b commit b52e8cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kvm/book3s_hv_nestedv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ gs_msg_ops_kvmhv_nestedv2_config_fill_info(struct kvmppc_gs_buff *gsb,
}

if (kvmppc_gsm_includes(gsm, KVMPPC_GSID_RUN_OUTPUT)) {
kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT,
cfg->vcpu_run_output_cfg);
rc = kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT,
cfg->vcpu_run_output_cfg);
if (rc < 0)
return rc;
}
Expand Down

0 comments on commit b52e8cd

Please sign in to comment.