umtx: handle allocation failire in umtx_pi_alloc()

Don't assume that this allocation will succeed. We may have been passed
M_NOWAIT.

The calling code already handles allocation failures, but the function
itself did not.

PR:		283807
MFC after:	1 week
This commit is contained in:
Kristof Provost
2025-01-05 17:09:08 +01:00
parent 93411b39ff
commit 50c1e179b5
+3
View File
@@ -1740,6 +1740,9 @@ umtx_pi_alloc(int flags)
struct umtx_pi *pi;
pi = uma_zalloc(umtx_pi_zone, M_ZERO | flags);
if (pi == NULL)
return (NULL);
TAILQ_INIT(&pi->pi_blocked);
atomic_add_int(&umtx_pi_allocated, 1);
return (pi);