linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about xt_find_table_lock
@ 2016-11-11 10:49 Julia Lawall
  2016-11-11 11:23 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2016-11-11 10:49 UTC (permalink / raw)
  To: pablo, kaber, kadlec, davem
  Cc: netfilter-devel, coreteam, netdev, linux-kernel, christophe.jaillet

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?

julia

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about xt_find_table_lock
  2016-11-11 10:49 question about xt_find_table_lock Julia Lawall
@ 2016-11-11 11:23 ` Florian Westphal
  2016-11-11 11:58   ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2016-11-11 11:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: pablo, kaber, kadlec, davem, netfilter-devel, coreteam, netdev,
	linux-kernel, christophe.jaillet

Julia Lawall <julia.lawall@lip6.fr> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about xt_find_table_lock
  2016-11-11 11:23 ` Florian Westphal
@ 2016-11-11 11:58   ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2016-11-11 11:58 UTC (permalink / raw)
  To: Florian Westphal
  Cc: Julia Lawall, pablo, kaber, kadlec, davem, netfilter-devel,
	coreteam, netdev, linux-kernel, christophe.jaillet



On Fri, 11 Nov 2016, Florian Westphal wrote:

> Julia Lawall <julia.lawall@lip6.fr> 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.

Thanks for the quick feedback.

julia

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-11 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-11 10:49 question about xt_find_table_lock Julia Lawall
2016-11-11 11:23 ` Florian Westphal
2016-11-11 11:58   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).