Re: [PATCH] net/netfiliter: Fix used uninitialized warn in ip_vs_proc_sync_conn()

From: Anna Schumaker
Date: Mon Nov 07 2016 - 10:44:24 EST


Hi Shuah,

On 11/07/2016 10:41 AM, Shuah Khan wrote:
> Fix the following warn:
>
> net/netfilter/ipvs/ip_vs_sync.c: In function âip_vs_proc_sync_connâ:
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: âopt.init_seqâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> struct ip_vs_sync_conn_options opt;
> ^~~
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: âopt.deltaâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: âopt.previous_deltaâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: â*((void *)&opt+12).init_seqâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: â*((void *)&opt+12).deltaâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> net/netfilter/ipvs/ip_vs_sync.c:1069:33: warning: â*((void *)&opt+12).previous_deltaâ may be used uninitialized in this function [-Wmaybe-uninitialized]

Are you sure you put the right commit message on this patch? The message describes a warning in ip_vs_sync.c, but the patch is for nfs4session.c.

Thanks,
Anna

>
> Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
> ---
> fs/nfs/nfs4session.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c
> index b629730..68e700e 100644
> --- a/fs/nfs/nfs4session.c
> +++ b/fs/nfs/nfs4session.c
> @@ -196,7 +196,7 @@ static int nfs4_slot_get_seqid(struct nfs4_slot_table *tbl, u32 slotid,
> static bool nfs4_slot_seqid_in_use(struct nfs4_slot_table *tbl,
> u32 slotid, u32 seq_nr)
> {
> - u32 cur_seq;
> + u32 cur_seq = 0;
> bool ret = false;
>
> spin_lock(&tbl->slot_tbl_lock);
>