mlxsw: spectrum_span: Do not dereference destination netdev
authorIdo Schimmel <idosch@mellanox.com>
Tue, 14 Jul 2020 14:20:58 +0000 (17:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2020 21:50:49 +0000 (14:50 -0700)
commit6edc8beab443ec23d10e489007b4e94d9a05846d
treee08839f1945300a733455476a8078448c43f4b83
parentf4a626e2ca09aeffd30509349759fb30379fe83f
mlxsw: spectrum_span: Do not dereference destination netdev

Currently, the destination netdev to which we mirror must be a valid
netdev. However, this is going to change with the introduction of
mirroring towards the CPU port, as the CPU port does not have a backing
netdev.

Avoid dereferencing the destination netdev when it is not clear if it is
valid or not.

Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c