Return-Path: Received: from mail-by2nam03on0099.outbound.protection.outlook.com ([104.47.42.99]:57621 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753212AbeA1W04 (ORCPT ); Sun, 28 Jan 2018 17:26:56 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Dmitry Monakhov , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 035/100] IB/core: Init subsys if compiled to vmlinuz-core Date: Sun, 28 Jan 2018 22:26:21 +0000 Message-ID: <20180128222547.7398-35-alexander.levin@microsoft.com> References: <20180128222547.7398-1-alexander.levin@microsoft.com> In-Reply-To: <20180128222547.7398-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Dmitry Monakhov [ Upstream commit a9cd1a673737dd81332fce1145801bfacfb90d90 ] 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 =3D>NULLPTR #Config CONFIG_NET_DEVLINK=3Dy CONFIG_MAY_USE_DEVLINK=3Dy CONFIG_MLX4_EN=3Dy Signed-off-by: Dmitry Monakhov Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/core/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/dev= ice.c index 84fc32a2c8b3..5e1be4949d5f 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1253,5 +1253,5 @@ static void __exit ib_core_cleanup(void) =20 MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_LS, 4); =20 -module_init(ib_core_init); +subsys_initcall(ib_core_init); module_exit(ib_core_cleanup); --=20 2.11.0