]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nfnetlink_queue: avoid harmless unnitialized variable warnings
authorArnd Bergmann <arnd@arndb.de>
Thu, 19 Nov 2015 12:49:59 +0000 (13:49 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Nov 2015 10:22:26 +0000 (11:22 +0100)
commit165e55ce8aea189d85261b959ae73c614a19d6b4
treeabf1875b35d7457902744a3ea6b408c150d2b8a7
parent6bbfe633f61acc2b4e5226ddb2dec5e915e3d7aa
netfilter: nfnetlink_queue: avoid harmless unnitialized variable warnings

Several ARM default configurations give us warnings on recent
compilers about potentially uninitialized variables in the
nfnetlink code in two functions:

net/netfilter/nfnetlink_queue.c: In function 'nfqnl_build_packet_message':
net/netfilter/nfnetlink_queue.c:519:19: warning: 'nfnl_ct' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (ct && nfnl_ct->build(skb, ct, ctinfo, NFQA_CT, NFQA_CT_INFO) < 0)

Moving the rcu_dereference(nfnl_ct_hook) call outside of the
conditional code avoids the warning without forcing us to
preinitialize the variable.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 8970f49522c8 ("netfilter: nfnetlink_queue: rename related to nfqueue attaching conntrack info")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink_queue.c