Several problems with error handling in whpx_get_xsave_state:
- Does not handle WHV_E_INSUFFICIENT_BUFFER, which occurs frequently
in practice for XSAVE state.
- Does not free xsavec_buf when an error occurs.
- Error message and return code use errno where they should use hr.
Fixes: cfaa3b6c95 ("whpx: xsave support")
Signed-off-by: Doug Cook <dcook@microsoft.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>