* [PATCH] netfilter: Fix several warnings in compat_mtw_from_user().
@ 2011-05-19 22:14 David Miller
2011-05-26 16:44 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2011-05-19 22:14 UTC (permalink / raw)
To: netfilter-devel
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>
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 1a92b36..2b5ca1a 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,
struct xt_target *wt;
void *dst = NULL;
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));
if (state->buf_kern_start)
dst = state->buf_kern_start + state->buf_kern_offset;
- entry_offset = (unsigned char *) mwt - base;
switch (compat_mwt) {
case EBT_COMPAT_MATCH:
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,
size_kern = wt->targetsize;
module_put(wt->me);
break;
+
+ default:
+ return -EINVAL;
}
state->buf_kern_offset += match_size + off;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: Fix several warnings in compat_mtw_from_user().
2011-05-19 22:14 [PATCH] netfilter: Fix several warnings in compat_mtw_from_user() David Miller
@ 2011-05-26 16:44 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2011-05-26 16:44 UTC (permalink / raw)
To: David Miller; +Cc: netfilter-devel
On 20/05/11 00:14, David Miller wrote:
>
> 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>
applied to my nf-2.6 tree, thanks.
http://1984.lsi.us.es/git/?p=net-2.6/.git;a=shortlog;h=refs/heads/pablo/nf-2.6-updates
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-26 16:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-19 22:14 [PATCH] netfilter: Fix several warnings in compat_mtw_from_user() David Miller
2011-05-26 16:44 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).