Commit 0d98ecb1 authored by Anders Roxell's avatar Anders Roxell Committed by Greg Kroah-Hartman

netfilter: ipt_CLUSTERIP: fix warning unused variable cn

commit 206b8cc5 upstream.

When CONFIG_PROC_FS isn't set the variable cn isn't used.

net/ipv4/netfilter/ipt_CLUSTERIP.c: In function ‘clusterip_net_exit’:
net/ipv4/netfilter/ipt_CLUSTERIP.c:849:24: warning: unused variable ‘cn’ [-Wunused-variable]
  struct clusterip_net *cn = clusterip_pernet(net);
                        ^~

Rework so the variable 'cn' is declared inside "#ifdef CONFIG_PROC_FS".

Fixes: b12f7bad ("netfilter: ipt_CLUSTERIP: remove wrong WARN_ON_ONCE in netns exit routine")
Signed-off-by: default avatarAnders Roxell <anders.roxell@linaro.org>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bd9959a
...@@ -846,9 +846,9 @@ static int clusterip_net_init(struct net *net) ...@@ -846,9 +846,9 @@ static int clusterip_net_init(struct net *net)
static void clusterip_net_exit(struct net *net) static void clusterip_net_exit(struct net *net)
{ {
#ifdef CONFIG_PROC_FS
struct clusterip_net *cn = clusterip_pernet(net); struct clusterip_net *cn = clusterip_pernet(net);
#ifdef CONFIG_PROC_FS
mutex_lock(&cn->mutex); mutex_lock(&cn->mutex);
proc_remove(cn->procdir); proc_remove(cn->procdir);
cn->procdir = NULL; cn->procdir = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment