Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uladzislau Rezki (Sony) and committed by
Greg Kroah-Hartman
6da3f337 6d1e4927

+3 -6
+2 -4
drivers/misc/vmw_vmci/vmci_context.c
··· 687 687 } 688 688 spin_unlock(&context->lock); 689 689 690 - if (found) { 691 - synchronize_rcu(); 692 - kfree(notifier); 693 - } 690 + if (found) 691 + kvfree_rcu(notifier); 694 692 695 693 vmci_ctx_put(context); 696 694
+1 -2
drivers/misc/vmw_vmci/vmci_event.c
··· 209 209 if (!s) 210 210 return VMCI_ERROR_NOT_FOUND; 211 211 212 - synchronize_rcu(); 213 - kfree(s); 212 + kvfree_rcu(s); 214 213 215 214 return VMCI_SUCCESS; 216 215 }