mlxsw: spectrum: Forbid linking of VLAN devices to devices that have uppers
authorIdo Schimmel <idosch@mellanox.com>
Sun, 8 Jul 2018 11:23:19 +0000 (14:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2018 14:26:45 +0000 (16:26 +0200)
commit2f1a56ef237d91bb649526292434fd60220d6b41
treeb96720d890861e8970dfde1a569e564b1d26a0e8
parent917692c9cdf5ea62e783d08dfef40bfb982a9dca
mlxsw: spectrum: Forbid linking of VLAN devices to devices that have uppers

Jiri Slaby noticed that the backport of upstream commit 25cc72a33835
("mlxsw: spectrum: Forbid linking to devices that have uppers") to
kernel 4.9.y introduced the same check twice in the same function
instead of in two different places.

Fix this by relocating one of the checks to its intended place, thus
preventing unsupported configurations as described in the original
commit.

Fixes: 73ee5a73e75f ("mlxsw: spectrum: Forbid linking to devices that have uppers")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c