mirror of
https://github.com/torvalds/linux
synced 2024-10-04 02:10:58 +00:00
misc: vmw_vmci: Switch to kvfree_rcu() API
Instead of invoking a synchronize_rcu() to free a pointer after a grace period we can directly make use of new API that does the same but in more efficient way. Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com> Link: https://lore.kernel.org/r/20211215111845.2514-6-urezki@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6d1e4927de
commit
6da3f33770
|
@ -687,10 +687,8 @@ int vmci_ctx_remove_notification(u32 context_id, u32 remote_cid)
|
||||||
}
|
}
|
||||||
spin_unlock(&context->lock);
|
spin_unlock(&context->lock);
|
||||||
|
|
||||||
if (found) {
|
if (found)
|
||||||
synchronize_rcu();
|
kvfree_rcu(notifier);
|
||||||
kfree(notifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
vmci_ctx_put(context);
|
vmci_ctx_put(context);
|
||||||
|
|
||||||
|
|
|
@ -209,8 +209,7 @@ int vmci_event_unsubscribe(u32 sub_id)
|
||||||
if (!s)
|
if (!s)
|
||||||
return VMCI_ERROR_NOT_FOUND;
|
return VMCI_ERROR_NOT_FOUND;
|
||||||
|
|
||||||
synchronize_rcu();
|
kvfree_rcu(s);
|
||||||
kfree(s);
|
|
||||||
|
|
||||||
return VMCI_SUCCESS;
|
return VMCI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue