lkml.org 
[lkml]   [2016]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] net/netfilter: Fix use uninitialized warn in nft_range_eval()
Date
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
\
 
 \ /
  Last update: 2016-11-07 16:43    [W:0.077 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site