[Bug 240545] patch to remove unneeded M_WAITOK return value checks
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Sep 12 21:38:10 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545
--- Comment #1 from Conrad Meyer <cem at 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 — 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 with M_WAITOK?
Yes, contigmalloc() can fail with M_WAITOK; some of the busdma allocation stuff
can fail with M_WAITOK. Normal malloc / UMA allocations with M_WAITOK can't
return NULL (just sleep indefinitely).
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list