Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2019 21:38:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 240545] patch to remove unneeded M_WAITOK return value checks
Message-ID:  <bug-240545-227-mB1wPTE8UW@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-240545-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-240545-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240545

--- Comment #1 from Conrad Meyer <cem@freebsd.org> ---
It is definitely ok for malloc, mallocarray, and realloc.  (We have a kernel
reallocf?  Huh.)  Honestly, reallocf with M_WAITOK seems like a mistake =E2=
=80=94 those
could instead/additionally be replaced with just realloc(M_WAITOK).

> Are there any cases to be aware of for why the check would be necessary w=
ith M_WAITOK?

Yes, contigmalloc() can fail with M_WAITOK; some of the busdma allocation s=
tuff
can fail with M_WAITOK.  Normal malloc / UMA allocations with M_WAITOK can't
return NULL (just sleep indefinitely).

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240545-227-mB1wPTE8UW>