[PATCH] net/netfilter: Fix use uninitialized warn in nft_range_eval()
From: Shuah Khan
Date: Mon Nov 07 2016 - 10:42:43 EST
Fix the following warn:
CC [M] net/netfilter/nft_range.o
8601,8605c9105
net/netfilter/nft_range.c: In function ânft_range_evalâ:
net/netfilter/nft_range.c:45:5: warning: âmismatchâ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (mismatch)
^
Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
---
net/netfilter/nft_range.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nft_range.c b/net/netfilter/nft_range.c
index c6d5358..fe5f69b 100644
--- a/net/netfilter/nft_range.c
+++ b/net/netfilter/nft_range.c
@@ -28,7 +28,7 @@ static void nft_range_eval(const struct nft_expr *expr,
const struct nft_pktinfo *pkt)
{
const struct nft_range_expr *priv = nft_expr_priv(expr);
- bool mismatch;
+ bool mismatch = false;
int d1, d2;
d1 = memcmp(®s->data[priv->sreg], &priv->data_from, priv->len);
--
2.9.3