Check we are in a critical section when calling vfp_discard. As we may call

it with a NULL thread pointer only check when it is non-NULL.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2016-10-15 09:54:22 +00:00
parent 2698bbbb5a
commit 403ddccb10

View file

@ -79,6 +79,10 @@ void
vfp_discard(struct thread *td)
{
#ifdef INVARIANTS
if (td != NULL)
CRITICAL_ASSERT(td);
#endif
if (PCPU_GET(fpcurthread) == td)
PCPU_SET(fpcurthread, NULL);