summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMaksym Glubokiy <maksym.glubokiy@plvision.eu>2022-10-06 21:06:00 +0200
committerJakub Kicinski <kuba@kernel.org>2022-10-11 02:59:53 +0200
commit32391e646a71fc4cca4a74740bf401423d7a926d (patch)
tree9b8675e125e04e737da599fda09c2b8528a45590 /drivers
parentocteontx2-pf: mcs: fix possible memory leak in otx2_probe() (diff)
downloadlinux-32391e646a71fc4cca4a74740bf401423d7a926d.tar.xz
linux-32391e646a71fc4cca4a74740bf401423d7a926d.zip
net: prestera: span: do not unbind things things that were never bound
Fixes: 13defa275eef ("net: marvell: prestera: Add matchall support") Signed-off-by: Maksym Glubokiy <maksym.glubokiy@plvision.eu> Link: https://lore.kernel.org/r/20221006190600.881740-1-maksym.glubokiy@plvision.eu Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/marvell/prestera/prestera_span.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_span.c b/drivers/net/ethernet/marvell/prestera/prestera_span.c
index f0e9d6ea88c5..1005182ce3bc 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_span.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_span.c
@@ -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;