ia32_get_fpcontext(): xfpusave can be legitimately NULL

Reported by:	cy
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Fixes:	bd9e0f5df681da8b5ef05
This commit is contained in:
Konstantin Belousov 2021-09-22 00:09:34 +03:00
parent ae5a522cae
commit c2ee4dfd04

View File

@ -99,6 +99,8 @@ ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp,
bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0],
sizeof(mcp->mc_fpstate));
mcp->mc_fpformat = fpuformat();
if (xfpusave == NULL)
return;
if (!use_xsave || cpu_max_ext_state_size <= sizeof(struct savefpu)) {
*xfpusave_len = 0;
*xfpusave = NULL;