KVM: PPC: Book3S HV: Free the queue pages in error path

If the xive_native_configure_queue() call fails, the qpage allocated is
not freed, which results in wasted memory. Fix this by freeing the qpage
in the error path.

Fixes: 5af5099385 ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller")
Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260917072839.78857-1-gautam@linux.ibm.com
This commit is contained in:
Gautam Menghani 2026-09-17 12:58:38 +05:30 committed by Madhavan Srinivasan
parent bda1626184
commit daf5a5a82c

View File

@ -961,9 +961,11 @@ static int xive_provision_queue(struct kvm_vcpu *vcpu, u8 prio)
*/
rc = xive_native_configure_queue(xc->vp_id, q, prio, qpage,
xive->q_order, true);
if (rc)
if (rc) {
pr_err("Failed to configure queue %d for VCPU %d\n",
prio, xc->server_num);
free_pages((unsigned long)qpage, xive->q_page_order);
}
return rc;
}