Skip to content

Commit 2a36ed7

Browse files
Tom Rixdavem330
authored andcommitted
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: 0f3faec ("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>
1 parent 9d2d38c commit 2a36ed7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls,
532532
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
533533
struct flow_dissector *dissector = rule->match.dissector;
534534
struct netlink_ext_ack *extack = cls->common.extack;
535+
int ret = -EOPNOTSUPP;
535536

536537
if (dissector->used_keys &
537538
~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
@@ -561,9 +562,10 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls,
561562
}
562563

563564
*vlan = (u16)match.key->vlan_id;
565+
ret = 0;
564566
}
565567

566-
return 0;
568+
return ret;
567569
}
568570

569571
static int

0 commit comments

Comments
 (0)