From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756246AbcKKLZa (ORCPT ); Fri, 11 Nov 2016 06:25:30 -0500 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:55832 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755993AbcKKLZ3 (ORCPT ); Fri, 11 Nov 2016 06:25:29 -0500 Date: Fri, 11 Nov 2016 12:23:07 +0100 From: Florian Westphal To: Julia Lawall Cc: pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, christophe.jaillet@wanadoo.fr Subject: Re: question about xt_find_table_lock Message-ID: <20161111112307.GA7274@breakpoint.cc> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Julia Lawall wrote: > The function xt_find_table_lock defined in net/netfilter/x_tables.c is > preceeded by a comment that says that it returns ERR_PTR() on error. But > looking at the definition, I only see occurrences of return NULL and > returns of pointers that have previously been dereferenced. Is it the > code or the documentation that is incorrect? The call sites seem to be > using IS_ERR_OR_NULL. Is there a plan to return ERR_PTR values in the > future? It used to return ERR_PTR, see: commit 7926dbfa4bc14e27f4e18a6184a031a1c1e077dc netfilter: don't use mutex_lock_interruptible() So the comment isn't correct anymore and callers could test vs NULL.