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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user