aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2011-05-19 18:14:39 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2011-05-26 13:09:07 -0400
commit97242c85a2c8160eac5a6e945209b5b6ae8ab5a3 (patch)
treec1d64596ae85c77580fe99b7c4cae3d41ca4fbf5 /net
parent9184a9cba622d9e38462ce11dff7da094b4fea84 (diff)
netfilter: Fix several warnings in compat_mtw_from_user().
Kill set but not used 'entry_offset'. Add a default case to the switch statement so the compiler can see that we always initialize off and size_kern before using them. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/netfilter/ebtables.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 1a92b369c820..2b5ca1a0054d 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1883,14 +1883,13 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
1883 struct xt_target *wt; 1883 struct xt_target *wt;
1884 void *dst = NULL; 1884 void *dst = NULL;
1885 int off, pad = 0; 1885 int off, pad = 0;
1886 unsigned int size_kern, entry_offset, match_size = mwt->match_size; 1886 unsigned int size_kern, match_size = mwt->match_size;
1887 1887
1888 strlcpy(name, mwt->u.name, sizeof(name)); 1888 strlcpy(name, mwt->u.name, sizeof(name));
1889 1889
1890 if (state->buf_kern_start) 1890 if (state->buf_kern_start)
1891 dst = state->buf_kern_start + state->buf_kern_offset; 1891 dst = state->buf_kern_start + state->buf_kern_offset;
1892 1892
1893 entry_offset = (unsigned char *) mwt - base;
1894 switch (compat_mwt) { 1893 switch (compat_mwt) {
1895 case EBT_COMPAT_MATCH: 1894 case EBT_COMPAT_MATCH:
1896 match = try_then_request_module(xt_find_match(NFPROTO_BRIDGE, 1895 match = try_then_request_module(xt_find_match(NFPROTO_BRIDGE,
@@ -1933,6 +1932,9 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
1933 size_kern = wt->targetsize; 1932 size_kern = wt->targetsize;
1934 module_put(wt->me); 1933 module_put(wt->me);
1935 break; 1934 break;
1935
1936 default:
1937 return -EINVAL;
1936 } 1938 }
1937 1939
1938 state->buf_kern_offset += match_size + off; 1940 state->buf_kern_offset += match_size + off;