On 03/25/2015 02:19 PM, Somnath Kotur wrote:
+static void ib_device_complete_cb(struct kref *kref)
+{
+ struct ib_device *device = container_of(kref, struct ib_device,
+ refcount);
+
+ if (device->reg_state >= IB_DEV_UNREGISTERING)
+ complete(&device->free);
+}
@@ -355,6 +393,9 @@ void ib_unregister_device(struct ib_device *device)
ib_device_unregister_sysfs(device);
+ ib_device_put(device);
+ wait_for_completion(&device->free);
Why is it necessary here to wait until the last reference is gone ? Why
doesn't ib_device_complete_cb() free any memory ?
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html