]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Prevent mirred-related crash on removal
authorYuval Mintz <yuvalm@mellanox.com>
Tue, 12 Sep 2017 06:50:53 +0000 (08:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Sep 2017 03:42:29 +0000 (20:42 -0700)
commitc9bfa1a3cf0a8afb6e415de3a19d6b799e24b25d
treea94b2df06a5ea99b648670ae46148660e00c8264
parent4c2ee9d155926a059644dbeacaeaf09757c18b3c
mlxsw: spectrum: Prevent mirred-related crash on removal

When removing the offloading of mirred actions under
matchall classifiers, mlxsw would find the destination port
associated with the offloaded action and utilize it for undoing
the configuration.

Depending on the order by which ports are removed, it's possible that
the destination port would get removed before the source port.
In such a scenario, when actions would be flushed for the source port
mlxsw would perform an illegal dereference as the destination port is
no longer listed.

Since the only item necessary for undoing the configuration on the
destination side is the port-id and that in turn is already maintained
by mlxsw on the source-port, simply stop trying to access the
destination port and use the port-id directly instead.

Fixes: a25b2c9e6d ("mlxsw: spectrum: Add support in matchall mirror TC offloading")
Signed-off-by: Yuval Mintz <yuvalm@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