lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun,  6 Nov 2016 13:53:34 +0100
From:   Nicholas Mc Guire <hofrat@...dl.org>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc:     Michal Hocko <mhocko@...e.com>,
        George Zhang <georgezhang@...are.com>,
        linux-kernel@...r.kernel.org, Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH 2/2] VMCI: drop unused variable

The boolean vmci_page_files is used to differentiate between old style
VMX and new-style, but the code actually only used this variable
at one point in an if/else that had no effect so it can be removed. 

Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.")
Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
---

drivers/misc/vmw_vmci/vmci_queue_pair.c:vmci_qp_broker_detach()
2232        if (entry->vmci_page_files)
2233                qp_host_unregister_user_memory(entry->produce_q,
2234                                               entry->
2235                                               consume_q);
2236        else
2237                qp_host_unregister_user_memory(entry->produce_q,
2238                                               entry->
2239                                               consume_q);

As this is the only place where vmci_page_files is being used this
could be dropped as well provided the dropped if/else is correct.

Patch was compile checked with: x86_64_defconfig + CONFIG_VMWARE_VMCI=m

Patch is against 4.9.0-rc2 (localversion-next is next-20161028)

 drivers/misc/vmw_vmci/vmci_queue_pair.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
index 6f6069c..1b515ac 100644
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -224,7 +224,6 @@ struct qp_broker_entry {
 	enum qp_broker_state state;
 	bool require_trusted_attach;
 	bool created_by_trusted;
-	bool vmci_page_files;	/* Created by VMX using VMCI page files */
 	struct vmci_queue *produce_q;
 	struct vmci_queue *consume_q;
 	struct vmci_queue_header saved_produce_q;
@@ -1435,7 +1434,6 @@ static int qp_broker_create(struct vmci_handle handle,
 	    !!(context->priv_flags & VMCI_PRIVILEGE_FLAG_RESTRICTED);
 	entry->created_by_trusted =
 	    !!(priv_flags & VMCI_PRIVILEGE_FLAG_TRUSTED);
-	entry->vmci_page_files = false;
 	entry->wakeup_cb = wakeup_cb;
 	entry->client_data = client_data;
 	entry->produce_q = qp_host_alloc_queue(guest_produce_size);
@@ -2112,8 +2110,6 @@ int vmci_qp_broker_set_page_store(struct vmci_handle handle,
 	else
 		entry->state = VMCIQPB_ATTACHED_MEM;
 
-	entry->vmci_page_files = true;
-
 	if (entry->state == VMCIQPB_ATTACHED_MEM) {
 		result =
 		    qp_notify_peer(true, handle, context_id, entry->create_id);
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ