Skip to content
Commit 007b01a2 authored by Valentine Fatiev's avatar Valentine Fatiev Committed by Greg Kroah-Hartman
Browse files

IB/ipoib: Add child to parent list only if device initialized

[ Upstream commit 91b01061 ]

Despite failure in ipoib_dev_init() we continue with initialization flow
and creation of child device. It causes to the situation where this child
device is added too early to parent device list.

Change the logic, so in case of failure we properly return error from
ipoib_dev_init() and add child only in success path.

Fixes: eaeb3984

 ("IB/ipoib: Move init code to ndo_init")
Signed-off-by: default avatarValentine Fatiev <valentinef@mellanox.com>
Reviewed-by: default avatarFeras Daoud <ferasda@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d48720ba
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment