Commit 0c236606 authored by Parvi Kaustubhi's avatar Parvi Kaustubhi Committed by Jason Gunthorpe

IB/usnic: Fix locking when unregistering

Move the call to usnic_ib_device_remove after usnic_ib_ibdev_list_lock has
been released.
Signed-off-by: default avatarParvi Kaustubhi <pkaustub@cisco.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent c8a7eb55
......@@ -470,15 +470,17 @@ static void usnic_ib_undiscover_pf(struct kref *kref)
&usnic_ib_ibdev_list, ib_dev_link) {
if (us_ibdev->pdev == dev) {
list_del(&us_ibdev->ib_dev_link);
usnic_ib_device_remove(us_ibdev);
found = true;
break;
}
}
WARN(!found, "Failed to remove PF %s\n", pci_name(dev));
mutex_unlock(&usnic_ib_ibdev_list_lock);
if (found)
usnic_ib_device_remove(us_ibdev);
else
WARN(1, "Failed to remove PF %s\n", pci_name(dev));
}
static struct usnic_ib_dev *usnic_ib_discover_pf(struct usnic_vnic *vnic)
......
Markdown is supported
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