]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commit
libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
authorJan Beulich <jbeulich@suse.com>
Wed, 9 Apr 2025 13:30:15 +0000 (15:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Apr 2025 13:30:15 +0000 (15:30 +0200)
commitcf1995fa8a24c7e51e781010680b042f49b38eda
treeb8b748768e7d01e36d7fce8bee70be8f6f7a572f
parent59bb316ea89e7f9461690fe00547d7d2af96321d
libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()

From their introduction all xc_hypercall_bounce_pre() uses, when they
failed, would properly cause exit from the function including cleanup,
yet without informing the caller of the failure. Purge the unlock_1
label for being both pointless and mis-named.

An earlier attempt to switch to the usual split between return value and
errno wasn't quite complete.

HWP work made the cleanup of the "available governors" array
conditional, neglecting the fact that the condition used may not be the
condition that was used to allocate the buffer (as the structure field
is updated upon getting back EAGAIN). Since cleanup can be done even if
no buffer was allocated, drop the conditional there again.

Fixes: 4513025a8790 ("libxc: convert sysctl interfaces over to hypercall buffers")
Amends: 73367cf3b4b4 ("libxc: Fix xc_pm API calls to return negative error and stash error in errno")
Fixes: 31e264c672bc ("pmstat&xenpm: Re-arrage for cpufreq union")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
tools/libs/ctrl/xc_pm.c