aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/security.c
diff options
context:
space:
mode:
authorJason Gunthorpe <[email protected]>2019-02-07 05:41:48 +0000
committerJason Gunthorpe <[email protected]>2019-02-08 23:56:45 +0000
commitb34b269ad85d7dd4a512487f2395c3be3e40f76a (patch)
tree4bb128453a260e22572f4c305afaad803bf78f97 /drivers/infiniband/core/security.c
parentRDMA/device: Check that the rename is nop under the lock (diff)
downloadkernel-b34b269ad85d7dd4a512487f2395c3be3e40f76a.tar.gz
kernel-b34b269ad85d7dd4a512487f2395c3be3e40f76a.zip
RDMA/device: Ensure that security memory is always freed
Since this only frees memory it should be done during the release callback. Otherwise there are possible error flows where it might not get called if registration aborts. Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/core/security.c')
-rw-r--r--drivers/infiniband/core/security.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
index a70d2ba312ed..dad6a94a43f3 100644
--- a/drivers/infiniband/core/security.c
+++ b/drivers/infiniband/core/security.c
@@ -558,13 +558,12 @@ void ib_security_cache_change(struct ib_device *device,
}
}
-void ib_security_destroy_port_pkey_list(struct ib_device *device)
+void ib_security_release_port_pkey_list(struct ib_device *device)
{
struct pkey_index_qp_list *pkey, *tmp_pkey;
int i;
for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) {
- spin_lock(&device->port_pkey_list[i].list_lock);
list_for_each_entry_safe(pkey,
tmp_pkey,
&device->port_pkey_list[i].pkey_list,
@@ -572,7 +571,6 @@ void ib_security_destroy_port_pkey_list(struct ib_device *device)
list_del(&pkey->pkey_index_list);
kfree(pkey);
}
- spin_unlock(&device->port_pkey_list[i].list_lock);
}
}