Commit 4e9a6139 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

net: microchip: sparx5: fix uninitialized variables

Smatch complains that "err" can be uninitialized on these paths.  Also
it's just nicer to "return 0;" instead of "return err;"

Fixes: 3a344f99 ("net: microchip: sparx5: Add support for TC flower ARP dissector")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y3eg9Ml/LmLR3L3C@kiliSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 32634819
......@@ -341,7 +341,7 @@ sparx5_tc_flower_handler_vlan_usage(struct sparx5_tc_flower_parse_usage *st)
st->used_keys |= BIT(FLOW_DISSECTOR_KEY_VLAN);
return err;
return 0;
out:
NL_SET_ERR_MSG_MOD(st->fco->common.extack, "vlan parse error");
return err;
......@@ -452,8 +452,10 @@ sparx5_tc_flower_handler_arp_usage(struct sparx5_tc_flower_parse_usage *st)
/* The IS2 ARP keyset does not support ARP hardware addresses */
if (!is_zero_ether_addr(mt.mask->sha) ||
!is_zero_ether_addr(mt.mask->tha))
!is_zero_ether_addr(mt.mask->tha)) {
err = -EINVAL;
goto out;
}
if (mt.mask->sip) {
ipval = be32_to_cpu((__force __be32)mt.key->sip);
......@@ -477,7 +479,7 @@ sparx5_tc_flower_handler_arp_usage(struct sparx5_tc_flower_parse_usage *st)
st->used_keys |= BIT(FLOW_DISSECTOR_KEY_ARP);
return err;
return 0;
out:
NL_SET_ERR_MSG_MOD(st->fco->common.extack, "arp parse error");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment