[PATCH 4/7] VMCI: Delete an unnecessary null pointer check in qp_broker_create()
From: SF Markus Elfring
Date: Wed Jan 10 2018 - 14:29:07 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Jan 2018 19:00:24 +0100
The exception handling code should usually only be reached with a valid
pointer in the local variable "entry" at the end of this function.
Thus remove an extra null pointer check here.
Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/misc/vmw_vmci/vmci_queue_pair.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
index 381e25c69c1f..7d4437240099 100644
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -1434,12 +1434,9 @@ static int qp_broker_create(struct vmci_handle handle,
return VMCI_SUCCESS;
error:
- if (entry != NULL) {
- qp_host_free_queue(entry->produce_q, guest_produce_size);
- qp_host_free_queue(entry->consume_q, guest_consume_size);
- kfree(entry);
- }
-
+ qp_host_free_queue(entry->produce_q, guest_produce_size);
+ qp_host_free_queue(entry->consume_q, guest_consume_size);
+ kfree(entry);
return result;
}
--
2.15.1