net/mlx5: Check for error in mlx5_attach_interface
authorHuy Nguyen <huyn@mellanox.com>
Wed, 15 Aug 2018 16:08:48 +0000 (11:08 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 6 Sep 2018 00:08:33 +0000 (17:08 -0700)
commit47bc94b82291e007da61ee1b3d18c77871f3e158
treec82f421f7b4c0cbff185923bf032af2d034c4176
parentdf7ddb2396cd162e64aaff9401be05e31e438961
net/mlx5: Check for error in mlx5_attach_interface

Currently, mlx5_attach_interface does not check for error
after calling intf->attach or intf->add. When these two calls
fails, the client is not initialized and will cause issues such as
kernel panic on invalid address in the teardown path (mlx5_detach_interface)

Fixes: 737a234bb638 ("net/mlx5: Introduce attach/detach to interface API")
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/dev.c