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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:42 +0000 (11:05 +0100)
commite829e487f193559f61dfdb5ccbcab3769251d921
treeb288b63aa252687aed1ecb66be8db94e0b5e67fa
parentf864b6130498e6c688bcb2a41fa3afbae6b12fa3
net: mscc: ocelot: fix using match before it is set

commit baa59504c1cd0cca7d41954a45ee0b3dc78e41a0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mscc/ocelot_flower.c