Date: Sun, 19 Aug 2001 02:35:51 -0400 From: Bosko Milekic <bmilekic@technokratis.com> To: Julian Elischer <julian@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_mbuf.c uipc_usrreq.c Message-ID: <20010819023551.B331@technokratis.com> In-Reply-To: <200108190430.f7J4UEJ01333@freefall.freebsd.org>; from julian@FreeBSD.org on Sat, Aug 18, 2001 at 09:30:13PM -0700 References: <200108190430.f7J4UEJ01333@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 18, 2001 at 09:30:13PM -0700, Julian Elischer wrote: > julian 2001/08/18 21:30:13 PDT > > Modified files: > sys/kern uipc_mbuf.c uipc_usrreq.c > Log: > Forgot to remove this un-needed test. (M_WAITOK won't fail) > I vaguely remember someone once proving it COULD return NULL.. > was that changed? This is correct. malloc(9) cannot fail (well it can, but it will call panic()) if it is called with M_WAITOK. The distinction is in the mbuf code where _mbuf allocations_ can either be called with M_DONWAIT (can fail if can't get resources) or M_TRYWAIT (can fail if can't get resources and have tried waiting to no avail). Thus, mbuf allocations should always be accompanied by a check for allocation failure and proper measures should be taken should this occur (i.e. drop packet, whatever). This is not the case for malloc(9). > Reminded by: BDE > > MFC after: 2 weeks > > Revision Changes Path > 1.87 +2 -2 src/sys/kern/uipc_mbuf.c > 1.70 +1 -3 src/sys/kern/uipc_usrreq.c -- Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010819023551.B331>
