[PATCH] net/netfilter: Fix use uninitialized warn in nft_range_eval()

Shuah Khan
2016-11-07T15:42:41Z

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@osg.samsung.com>
---
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(&regs->data[priv->sreg], &priv->data_from, priv->len);
--
2.9.3