summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorLeon Romanovsky2019-02-18 21:25:47 +0100
committerJason Gunthorpe2019-02-19 05:04:36 +0100
commit41eda65c6100930d95bb854a0114f3544593070c (patch)
tree64ae996d521909ccb72a35ba4a5485cfcc125aa9 /drivers/infiniband/core/device.c
parentRDMA/restrack: Reduce scope of synchronization lock while updating DB (diff)
downloadkernel-qcow2-linux-41eda65c6100930d95bb854a0114f3544593070c.tar.gz
kernel-qcow2-linux-41eda65c6100930d95bb854a0114f3544593070c.tar.xz
kernel-qcow2-linux-41eda65c6100930d95bb854a0114f3544593070c.zip
RDMA/restrack: Hide restrack DB from IB/core
There is no need to expose internals of restrack DB to IB/core. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 3eddc6e67a16..f7e206033d39 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -45,6 +45,7 @@
#include <rdma/ib_cache.h>
#include "core_priv.h"
+#include "restrack.h"
MODULE_AUTHOR("Roland Dreier");
MODULE_DESCRIPTION("core kernel InfiniBand API");
@@ -338,7 +339,10 @@ struct ib_device *_ib_alloc_device(size_t size)
if (!device)
return NULL;
- rdma_restrack_init(device);
+ if (rdma_restrack_init(device)) {
+ kfree(device);
+ return NULL;
+ }
device->dev.class = &ib_class;
device->groups[0] = &ib_dev_attr_group;