From: Gustavo A. R. Silva Date: Fri, 18 Aug 2017 01:43:10 +0000 (-0500) Subject: vmci: fix duplicated code for different branches X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=234b7f8d3bf2738024b155b87303ed1218e620fa;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vmci: fix duplicated code for different branches Refactor code in order to avoid identical code for different branches. This issue was detected with the help of Coccinelle. Addresses-Coverity-ID: 1226762 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index 06c4974ee8dd..8af5c2672f71 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -2235,14 +2235,8 @@ int vmci_qp_broker_detach(struct vmci_handle handle, struct vmci_ctx *context) handle.context, handle.resource, result); - if (entry->vmci_page_files) - qp_host_unregister_user_memory(entry->produce_q, - entry-> - consume_q); - else - qp_host_unregister_user_memory(entry->produce_q, - entry-> - consume_q); + qp_host_unregister_user_memory(entry->produce_q, + entry->consume_q); }