lkml.org 
[lkml]   [2018]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 4/7] VMCI: Delete an unnecessary null pointer check in qp_broker_create()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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
\
 
 \ /
  Last update: 2018-01-14 23:22    [W:0.076 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site