RDMA/restrack: Add general infrastructure to track RDMA resources
[linux-2.6-microblaze.git] / drivers / infiniband / core / device.c
index 2826e06..e8010e7 100644 (file)
@@ -263,6 +263,8 @@ struct ib_device *ib_alloc_device(size_t size)
        if (!device)
                return NULL;
 
+       rdma_restrack_init(&device->res);
+
        device->dev.class = &ib_class;
        device_initialize(&device->dev);
 
@@ -596,6 +598,8 @@ void ib_unregister_device(struct ib_device *device)
        }
        up_read(&lists_rwsem);
 
+       rdma_restrack_clean(&device->res);
+
        ib_device_unregister_rdmacg(device);
        ib_device_unregister_sysfs(device);