From owner-cvs-all Sat Aug 18 23:34:12 2001 Delivered-To: cvs-all@freebsd.org Received: from technokratis.com (modemcable093.62-201-24.mtl.mc.videotron.ca [24.201.62.93]) by hub.freebsd.org (Postfix) with ESMTP id 4C2D437B411; Sat, 18 Aug 2001 23:34:05 -0700 (PDT) (envelope-from bmilekic@technokratis.com) Received: (from bmilekic@localhost) by technokratis.com (8.11.4/8.11.3) id f7J6Zp900428; Sun, 19 Aug 2001 02:35:51 -0400 (EDT) (envelope-from bmilekic) Date: Sun, 19 Aug 2001 02:35:51 -0400 From: Bosko Milekic To: Julian Elischer 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> References: <200108190430.f7J4UEJ01333@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200108190430.f7J4UEJ01333@freefall.freebsd.org>; from julian@FreeBSD.org on Sat, Aug 18, 2001 at 09:30:13PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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