Linux Netfilter development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: aconole@bytheb.org
Cc: netfilter-devel@vger.kernel.org
Subject: [bug report] netfilter: convert while loops to for loops
Date: Tue, 6 Dec 2016 16:10:33 +0300	[thread overview]
Message-ID: <20161206131033.GA20750@elgon.mountain> (raw)

Hello Aaron Conole,

This is a semi-automatic email about new static checker warnings.

The patch 66cfc1dd07c7: "netfilter: convert while loops to for loops" 
from Nov 15, 2016, leads to the following Smatch complaint:

net/bridge/br_netfilter_hooks.c:1016 br_nf_hook_thresh()
	 warn: variable dereferenced before check 'elem' (see line 1012)

net/bridge/br_netfilter_hooks.c
  1011		for (elem = rcu_dereference(net->nf.hooks[NFPROTO_BRIDGE][hook]);
  1012		     nf_hook_entry_priority(elem) <= NF_BR_PRI_BRNF;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dereference inside function.

  1013		     elem = rcu_dereference(elem->next))
  1014			;
  1015	
  1016		if (!elem)
                     ^^^^
This can't be reached without already dereferencing "elem".

  1017			return okfn(net, sk, skb);
  1018	

regards,
dan carpenter

                 reply	other threads:[~2016-12-06 13:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161206131033.GA20750@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=aconole@bytheb.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox