aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/vmw_vmci/vmci_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/vmw_vmci/vmci_resource.c')
-rw-r--r--drivers/misc/vmw_vmci/vmci_resource.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_resource.c b/drivers/misc/vmw_vmci/vmci_resource.c
index a196f84a4fd2..9a53a30de445 100644
--- a/drivers/misc/vmw_vmci/vmci_resource.c
+++ b/drivers/misc/vmw_vmci/vmci_resource.c
@@ -46,11 +46,10 @@ static struct vmci_resource *vmci_resource_lookup(struct vmci_handle handle,
46 enum vmci_resource_type type) 46 enum vmci_resource_type type)
47{ 47{
48 struct vmci_resource *r, *resource = NULL; 48 struct vmci_resource *r, *resource = NULL;
49 struct hlist_node *node;
50 unsigned int idx = vmci_resource_hash(handle); 49 unsigned int idx = vmci_resource_hash(handle);
51 50
52 rcu_read_lock(); 51 rcu_read_lock();
53 hlist_for_each_entry_rcu(r, node, 52 hlist_for_each_entry_rcu(r,
54 &vmci_resource_table.entries[idx], node) { 53 &vmci_resource_table.entries[idx], node) {
55 u32 cid = r->handle.context; 54 u32 cid = r->handle.context;
56 u32 rid = r->handle.resource; 55 u32 rid = r->handle.resource;
@@ -146,12 +145,11 @@ void vmci_resource_remove(struct vmci_resource *resource)
146 struct vmci_handle handle = resource->handle; 145 struct vmci_handle handle = resource->handle;
147 unsigned int idx = vmci_resource_hash(handle); 146 unsigned int idx = vmci_resource_hash(handle);
148 struct vmci_resource *r; 147 struct vmci_resource *r;
149 struct hlist_node *node;
150 148
151 /* Remove resource from hash table. */ 149 /* Remove resource from hash table. */
152 spin_lock(&vmci_resource_table.lock); 150 spin_lock(&vmci_resource_table.lock);
153 151
154 hlist_for_each_entry(r, node, &vmci_resource_table.entries[idx], node) { 152 hlist_for_each_entry(r, &vmci_resource_table.entries[idx], node) {
155 if (vmci_handle_is_equal(r->handle, resource->handle)) { 153 if (vmci_handle_is_equal(r->handle, resource->handle)) {
156 hlist_del_init_rcu(&r->node); 154 hlist_del_init_rcu(&r->node);
157 break; 155 break;