Skip to contentSkip to conversation

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

PATCH Jason Gunthorpe 1 participant 1 message Jul 4, 2019 1 message not in the archive InfiniBand

lore
Share & tools
lore

Jason Gunthorpe

author Applied
#1 lore raw
In reply to a message not in the archive
Quoted 9 lines · Leon Romanovsky

From: Valentine Fatiev <[email protected]>

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.

Quoted 7 lines
Fixes eaeb39842508 ("IB/ipoib: Move init code to ndo_init")
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 34 +++++++++++++----------
 1 file changed, 20 insertions(+), 14 deletions(-)

Applied to for-next, thanks

Jason