DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/enic: fix build with GCC 7.5
Date: Mon, 18 Oct 2021 12:16:01 +0100	[thread overview]
Message-ID: <5f0c9b9e-6c15-eaaa-b015-1a88286c17fc@intel.com> (raw)
In-Reply-To: <CAJFAV8zgCwkR6EXTW97TofhzPCX5tC48gpzazWx3MxCYRD3a4w@mail.gmail.com>

On 10/15/2021 12:16 PM, David Marchand wrote:
> On Fri, Oct 15, 2021 at 12:28 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> Build error:
>> ../drivers/net/enic/enic_fm_flow.c: In function 'enic_fm_flow_parse':
>> ../drivers/net/enic/enic_fm_flow.c:1467:24:
>>          error: 'dev' may be used uninitialized in this function
>>          [-Werror=maybe-uninitialized]
>>      struct rte_eth_dev *dev;
>>                          ^~~
>> ../drivers/net/enic/enic_fm_flow.c:1580:24:
>>          error: 'dev' may be used uninitialized in this function
>>          [-Werror=maybe-uninitialized]
>>      struct rte_eth_dev *dev;
>>                          ^~~
>> ../drivers/net/enic/enic_fm_flow.c:1599:24:
>>          error: 'dev' may be used uninitialized in this function
>>          [-Werror=maybe-uninitialized]
>>      struct rte_eth_dev *dev;
>>                          ^~~
>>
>> Build error looks like false positive, but to silence the compiler
>> initializing the pointer with NULL.
> 
> enic_fm_check_transfer_dst() contains branches where dev is not set
> and those branches return rte_flow_error_set return value.
> dev is dereferenced later based on this return value == 0.
> 
> So the compiler probably thinks that rte_flow_error_set may return 0.
> rte_flow_error_set is outside of compiler "view" at the moment it
> compiles enic_fm_flow.c, so the compiler making the assumption this
> function can return 0 is being prudent from my pov.
> 
> 
>>
>> Fixes: 7968917ccf64 ("net/enic: support meta flow actions to overrule destinations")
>>
>> Reported-by: David Marchand <david.marchand@redhat.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Your fix looks good in any case.
> 
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 

Applied to dpdk-next-net/main, thanks.


  reply	other threads:[~2021-10-18 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 10:28 Ferruh Yigit
2021-10-15 11:16 ` David Marchand
2021-10-18 11:16   ` Ferruh Yigit [this message]
2021-10-18 15:55     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f0c9b9e-6c15-eaaa-b015-1a88286c17fc@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hyonkim@cisco.com \
    --cc=johndale@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).