From: Christoph Hellwig Subject: Re: [PATCH 12/17] lockd: handle fl_notify callbacks Date: Mon, 9 Apr 2007 19:43:52 +0100 Message-ID: <20070409184352.GC28716@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@osdl.org, Trond Myklebust , Marc Eshel , linux-fsdevel@vger.kernel.org To: "J. Bruce Fields" Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:50495 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753407AbXDISn5 (ORCPT ); Mon, 9 Apr 2007 14:43:57 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Apr 05, 2007 at 07:41:02PM -0400, J. Bruce Fields wrote: > + if (block->b_fl) > + kfree(block->b_fl); kfree(NULL) is fine. > +static void > +nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf, > + int result) > +{ > + block->b_flags |= B_GOT_CALLBACK; > + if (result == 0) > + block->b_granted = 1; > + else > + block->b_flags |= B_TOO_LATE; > + if (conf) { > + block->b_fl = kzalloc(sizeof(struct file_lock), GFP_KERNEL); > + if (block->b_fl) > + locks_copy_lock(block->b_fl, conf); > + } > +} Shouldn't there be a way to propagate errors back to the caller when the kzalloc fails?