]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
IB/core: Init subsys if compiled to vmlinuz-core
authorDmitry Monakhov <dmonakhov@openvz.org>
Mon, 27 Nov 2017 13:39:05 +0000 (13:39 +0000)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 1 Dec 2017 19:21:26 +0000 (12:21 -0700)
Once infiniband is compiled as a core component its subsystem must be
enabled before device initialization. Otherwise there is a NULL pointer
dereference during mlx4_core init, calltrace:
->device_add
  if (dev->class) {
     deref  dev->class->p =>NULLPTR

#Config
CONFIG_NET_DEVLINK=y
CONFIG_MAY_USE_DEVLINK=y
CONFIG_MLX4_EN=y

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c

index 84fc32a2c8b3e8fc4dfed5be20cbea0921ee737e..5e1be4949d5fa8d4cfa4d802fa34a5ff71d4701b 100644 (file)
@@ -1253,5 +1253,5 @@ static void __exit ib_core_cleanup(void)
 
 MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_LS, 4);
 
-module_init(ib_core_init);
+subsys_initcall(ib_core_init);
 module_exit(ib_core_cleanup);