From: pablo@netfilter.org
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [PATCH 4/5] netfilter: Fix several warnings in compat_mtw_from_user().
Date: Fri, 27 May 2011 13:44:56 +0200 [thread overview]
Message-ID: <1306496697-12196-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1306496697-12196-1-git-send-email-pablo@netfilter.org>
From: David Miller <davem@davemloft.net>
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>
---
net/bridge/netfilter/ebtables.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
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;
--
1.7.2.5
next prev parent reply other threads:[~2011-05-27 11:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 11:44 [PATCH 0/5] Netfilter updates for net-2.6 pablo
2011-05-27 11:44 ` [PATCH 1/5] netfilter: ipset: Use proper timeout value to jiffies conversion pablo
2011-05-27 11:44 ` [PATCH 2/5] netfilter: ipset: remove unused variable from type_pf_tdel() pablo
2011-05-27 11:44 ` [PATCH 3/5] netfilter: ipset: fix ip_set_flush return code pablo
2011-05-27 11:44 ` pablo [this message]
2011-05-27 11:44 ` [PATCH 5/5] IPVS: bug in ip_vs_ftp, same list heaad used in all netns pablo
2011-05-27 17:06 ` [PATCH 0/5] Netfilter updates for net-2.6 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306496697-12196-5-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).