]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Fix refcount bug on span entries
authorYotam Gigi <yotamg@mellanox.com>
Fri, 11 Nov 2016 15:34:25 +0000 (16:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 13 Nov 2016 17:51:00 +0000 (12:51 -0500)
commit4cdd2d2fababc8a8d92ca9f8bfb8ef7661cca7c5
treef00e19c06fdbd7dccfad6e1223ed6bb451d849f6
parent268e9588bddc0dd0740f5efb870f483cc8ab994d
mlxsw: spectrum: Fix refcount bug on span entries

When binding port to a newly created span entry, its refcount is
initialized to zero even though it has a bound port. That leads
to unexpected behaviour when the user tries to delete that port
from the span entry.

Fix this by initializing the reference count to 1.

Also add a warning to put function.

Fixes: a25b2c9e6d13 ("mlxsw: spectrum: Add support in matchall mirror TC offloading")
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c