From owner-freebsd-fs@FreeBSD.ORG Fri Jun 11 15:53:11 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A3E51065670 for ; Fri, 11 Jun 2010 15:53:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 499D48FC12 for ; Fri, 11 Jun 2010 15:53:11 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id ECFC146C13; Fri, 11 Jun 2010 11:53:10 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EF5B78A03C; Fri, 11 Jun 2010 11:53:09 -0400 (EDT) From: John Baldwin To: freebsd-fs@freebsd.org Date: Fri, 11 Jun 2010 11:51:21 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <20100611103803.GA1855@pm513-1.comsys.ntu-kpi.kiev.ua> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006111151.21925.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 11:53:10 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Subject: Re: Testers: NFSv3 support for pxeboot for nfs diskless root X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 15:53:11 -0000 On Friday 11 June 2010 11:07:57 am Rick Macklem wrote: > > On Fri, 11 Jun 2010, Andrey Simonenko wrote: > > > > > Shouldn't return values from malloc() calls be checked? > > Yea, I suppose that's a good idea, although I think all that can be > done is print a failure message, since it's "dead in the water" at > that point. > > > Also additional checks for NULL values before free() calls can be removed, > > at least this will reduce size of code. There is PR/83424 related to this. > > > My only concern here would be if someone were to change Free() so it > doesn't check for a null pointer, but since it does now, I suppose > it's a feature and shouldn't be changed. > > Anyone else have an opinion on this? (ie. Whether I should just assume > that Free() checks for the NULL ptr.) free() in the kernel and userland also check for NULL, so I think it's ok to assume the same behavior for libstand. -- John Baldwin