Commit 32391e64 authored by Maksym Glubokiy's avatar Maksym Glubokiy Committed by Jakub Kicinski

net: prestera: span: do not unbind things things that were never bound

Fixes: 13defa27 ("net: marvell: prestera: Add matchall support")
Signed-off-by: default avatarMaksym Glubokiy <maksym.glubokiy@plvision.eu>
Link: https://lore.kernel.org/r/20221006190600.881740-1-maksym.glubokiy@plvision.euSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent af7d23f9
......@@ -107,7 +107,7 @@ static int prestera_span_put(struct prestera_switch *sw, u8 span_id)
entry = prestera_span_entry_find_by_id(sw->span, span_id);
if (!entry)
return false;
return -ENOENT;
if (!refcount_dec_and_test(&entry->ref_count))
return 0;
......@@ -151,6 +151,9 @@ int prestera_span_rule_del(struct prestera_flow_block_binding *binding,
{
int err;
if (binding->span_id == PRESTERA_SPAN_INVALID_ID)
return -ENOENT;
err = prestera_hw_span_unbind(binding->port, ingress);
if (err)
return err;
......
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