]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Avoid doing a cleanup call if the profile doesn't have it
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 15 Jun 2017 17:08:32 +0000 (20:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:41:37 +0000 (14:41 +0200)
commitc7d1260afbd09f0240f858620c708ab6f776f4b9
treeb8a011f1a984211330b877d7e01a6ac069a09f5c
parent050efbe12925bc9fe1fa2695afc2ba186c1f9cc2
net/mlx5e: Avoid doing a cleanup call if the profile doesn't have it

[ Upstream commit 31ac93386d135a6c96de9c8bab406f5ccabf5a4d ]

The error flow of mlx5e_create_netdev calls the cleanup call
of the given profile without checking if it exists, fix that.

Currently the VF reps don't register that callback and we crash
if getting into error -- can be reproduced by the user doing ctrl^C
while attempting to change the sriov mode from legacy to switchdev.

Fixes: 26e59d8077a3 '(net/mlx5e: Implement mlx5e interface attach/detach callbacks')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Sabrina Dubroca <sdubroca@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c