OSDN Git Service

net: mscc: ocelot: fix using match before it is set
authorTom Rix <trix@redhat.com>
Tue, 18 Jan 2022 13:41:10 +0000 (05:41 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jan 2022 14:34:43 +0000 (14:34 +0000)
commitbaa59504c1cd0cca7d41954a45ee0b3dc78e41a0
tree319e90aae50aca0e334b3f6f373b58d4b1b1c251
parentf1131b9c23fb4a3540a774828ff49f421619f902
net: mscc: ocelot: fix using match before it is set

Clang static analysis reports this issue
ocelot_flower.c:563:8: warning: 1st function call argument
  is an uninitialized value
    !is_zero_ether_addr(match.mask->dst)) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The variable match is used before it is set.  So move the
block.

Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_flower.c