From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: Is a NULL check missing in nfs_lookup? Date: Fri, 5 Jan 2007 12:23:04 -0700 Message-ID: <20070105192304.GH24620@parisc-linux.org> References: <1167999770.6050.39.camel@lade.trondhjem.org> <200701051910.l05JA6iq011061@agora.fsl.cs.sunysb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Trond Myklebust , Chaitanya Patti , linux-fsdevel@vger.kernel.org Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:43032 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422689AbXAETXH (ORCPT ); Fri, 5 Jan 2007 14:23:07 -0500 To: Erez Zadok Content-Disposition: inline In-Reply-To: <200701051910.l05JA6iq011061@agora.fsl.cs.sunysb.edu> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Jan 05, 2007 at 02:10:06PM -0500, Erez Zadok wrote: > Ah, ok. So why not put an ASSERT in there, or at least a comment, to make > the code clearer. As it stands, anyone looking at the code in the future > can easily rediscover this "bug" that dereferences a null ptr. Because anyone poking in the VFS should take the time to understand how it works? Adding crap like BUG_ON(!nd) is pointless -- you don't get a clearer backtrace from that than you do from a null pointer.