]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-switch: fix default return of dpaa2_switch_flower_parse_mirror_key
authorTom Rix <trix@redhat.com>
Mon, 14 Feb 2022 15:41:39 +0000 (07:41 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Feb 2022 14:31:43 +0000 (14:31 +0000)
commit51161a715deefe8431d79da61bb7cce9e5f0755f
treef16572374f1d293c0d182c5ff2c0b548ae0c9693
parent7051b3f61f1e1e5a8dd17bc772ccc13a3288dfb1
dpaa2-switch: fix default return of dpaa2_switch_flower_parse_mirror_key

Clang static analysis reports this representative problem
dpaa2-switch-flower.c:616:24: warning: The right operand of '=='
  is a garbage value
  tmp->cfg.vlan_id == vlan) {
                   ^  ~~~~
vlan is set in dpaa2_switch_flower_parse_mirror_key(). However
this function can return success without setting vlan.  So
change the default return to -EOPNOTSUPP.

Fixes: cc91dac254bd ("dpaa2-switch: add VLAN based mirroring")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c