Make sure default VNET is set when adding a new interface in mlx5core.
Adding an interface might be done outside the device_attach() routine and will then cause a panic, due to the VNET not being set. MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
7927756d5b
commit
ab9224328e
@ -956,7 +956,9 @@ static void mlx5_add_device(struct mlx5_interface *intf, struct mlx5_priv *priv)
|
||||
dev_ctx = kmalloc(sizeof(*dev_ctx), GFP_KERNEL);
|
||||
|
||||
dev_ctx->intf = intf;
|
||||
CURVNET_SET_QUIET(vnet0);
|
||||
dev_ctx->context = intf->add(dev);
|
||||
CURVNET_RESTORE();
|
||||
|
||||
if (dev_ctx->context) {
|
||||
spin_lock_irq(&priv->ctx_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user