Skip to content

Commit b52e8cd

Browse files
tititiou36mpe
authored andcommitted
KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_ops_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
1 parent 651d61b commit b52e8cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/kvm/book3s_hv_nestedv2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ gs_msg_ops_kvmhv_nestedv2_config_fill_info(struct kvmppc_gs_buff *gsb,
7171
}
7272

7373
if (kvmppc_gsm_includes(gsm, KVMPPC_GSID_RUN_OUTPUT)) {
74-
kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT,
75-
cfg->vcpu_run_output_cfg);
74+
rc = kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT,
75+
cfg->vcpu_run_output_cfg);
7676
if (rc < 0)
7777
return rc;
7878
}

0 commit comments

Comments
 (0)