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/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- 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 — 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.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240545-227-mB1wPTE8UW>
