mlxsw: spectrum_switchdev: Avoid leaking FID's reference count
authorIdo Schimmel <idosch@mellanox.com>
Thu, 6 Dec 2018 17:44:51 +0000 (17:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Dec 2018 21:31:08 +0000 (13:31 -0800)
commitf58a83c207b791c6586b9675a589db5c6ac7909e
tree0ac2d47532b404e0215eec6615dc2be4873e45e6
parent050fc01fb1d916058605569cd7f4e15152afc3af
mlxsw: spectrum_switchdev: Avoid leaking FID's reference count

It should never be possible for a user to set a VNI on a FID in case one
is already set. The driver therefore returns an error, but fails to drop
the reference count taken earlier when calling
mlxsw_sp_fid_8021d_lookup().

Drop the reference when this unlikely error is hit.

Fixes: 1c30d1836aeb ("mlxsw: spectrum: Enable VxLAN enslavement to bridges")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c