提交 97242c85 编写于 作者: D David Miller 提交者: Pablo Neira Ayuso

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: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 9184a9cb
...@@ -1883,14 +1883,13 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt, ...@@ -1883,14 +1883,13 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
struct xt_target *wt; struct xt_target *wt;
void *dst = NULL; void *dst = NULL;
int off, pad = 0; int off, pad = 0;
unsigned int size_kern, entry_offset, match_size = mwt->match_size; unsigned int size_kern, match_size = mwt->match_size;
strlcpy(name, mwt->u.name, sizeof(name)); strlcpy(name, mwt->u.name, sizeof(name));
if (state->buf_kern_start) if (state->buf_kern_start)
dst = state->buf_kern_start + state->buf_kern_offset; dst = state->buf_kern_start + state->buf_kern_offset;
entry_offset = (unsigned char *) mwt - base;
switch (compat_mwt) { switch (compat_mwt) {
case EBT_COMPAT_MATCH: case EBT_COMPAT_MATCH:
match = try_then_request_module(xt_find_match(NFPROTO_BRIDGE, 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,6 +1932,9 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
size_kern = wt->targetsize; size_kern = wt->targetsize;
module_put(wt->me); module_put(wt->me);
break; break;
default:
return -EINVAL;
} }
state->buf_kern_offset += match_size + off; state->buf_kern_offset += match_size + off;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册