]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
vmci: fix duplicated code for different branches
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 18 Aug 2017 01:43:10 +0000 (20:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:55:50 +0000 (16:55 +0200)
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 <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_vmci/vmci_queue_pair.c

index 06c4974ee8dd1ee40b328d2bc84ff751480a34c1..8af5c2672f71cec186af5daf4dc50008fe771c7a 100644 (file)
@@ -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);
 
                }