diff mbox series

netfilter: ebtables: clean up initialization of buf

Message ID 20171016102402.10358-1-colin.king@canonical.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series netfilter: ebtables: clean up initialization of buf | expand

Commit Message

Colin Ian King Oct. 16, 2017, 10:24 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

buf is initialized to buf_start and then set on the next statement
to buf_start + offsets[i].  Clean this up to just initialize buf
to buf_start + offsets[i] to clean up the clang build warning:
"Value stored to 'buf' during its initialization is never read"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/bridge/netfilter/ebtables.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Pablo Neira Ayuso Nov. 6, 2017, 1:50 p.m. UTC | #1
On Mon, Oct 16, 2017 at 11:24:02AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> buf is initialized to buf_start and then set on the next statement
> to buf_start + offsets[i].  Clean this up to just initialize buf
> to buf_start + offsets[i] to clean up the clang build warning:
> "Value stored to 'buf' during its initialization is never read"

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 3b3dcf719e07..37817d25b63d 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -2112,9 +2112,8 @@  static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base,
 	for (i = 0, j = 1 ; j < 4 ; j++, i++) {
 		struct compat_ebt_entry_mwt *match32;
 		unsigned int size;
-		char *buf = buf_start;
+		char *buf = buf_start + offsets[i];
 
-		buf = buf_start + offsets[i];
 		if (offsets[i] > offsets[j])
 			return -EINVAL;