Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107AbeAJT3D (ORCPT + 1 other); Wed, 10 Jan 2018 14:29:03 -0500 Received: from mout.web.de ([217.72.192.78]:54890 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841AbeAJT26 (ORCPT ); Wed, 10 Jan 2018 14:28:58 -0500 Subject: [PATCH 4/7] VMCI: Delete an unnecessary null pointer check in qp_broker_create() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Al Viro , Alexey Dobriyan , Andrew Morton , Arnd Bergmann , Dan Carpenter , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Ingo Molnar , Masahiro Yamada Cc: LKML References: <2747f123-a95d-bc68-b858-0327dce3758b@users.sourceforge.net> Message-ID: <423462ca-25f1-3249-2609-ecfb0da6d987@users.sourceforge.net> Date: Wed, 10 Jan 2018 20:28:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <2747f123-a95d-bc68-b858-0327dce3758b@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:N+abVXJi3uQF+/0F4Ji7OF0gPSJc9ns3CRt7TaguAUNUs9qSARH 41D81slJcADAHo/kVXz1ReZgnKwFxhSzoRPkwQ77pQwnKywljJzlL61XceQPQhWmFUgH/cC fD+ar/xG6V9688s5vixLVBSoxZmGZwim3fC+m25vGLWIXQYDnU7hEJjYPWR+mIkfmy/R89w 58Y3oUqPoPVCU1LaELhSg== X-UI-Out-Filterresults: notjunk:1;V01:K0:30ebybNq9Bw=:XwCoc6tBWt7p8ZTINzuZxp jxfdzM8ML1o71Z2NP3npTfr9EyhldWCKxq7bSICTQ/SA8OSMOskATdrvQHNtNkhpmbmRe8nft Uk8Fk6kraMlBSwZoF/3AqFWT9xlrtn5XRcdhz6PrUMtxhpQSGoEL4kYPao7ReM04b6s1I+bps 5YZ8AbVhSTwJbNSLAWaWKwFHryYgImDWyBOM1m0FkUQkjE+fim1zWrb7bglcmCWirtyEAmCjM 4vGhkAkpv7llxPnW0lSKI0JwyhxMCs3Qqd3bC8lo8DoOq5BIRd6tCueIe3qg45KmXkfnVlGIp He3A9jU6Yd/Y84Ge37/5ws2q3Ebbr+d4BwdZJU6cbuJE5X4Wa3oLHLXDCZ7miWsXCIdi4DFG9 x5wrMrU8LJefpVP50w1Tfs9Nmf5WtzYZSHvx19ED/QhljVLugM20sbixUvJX4gR2omULLKMQv P5FcrB5WSbWb4/skRl1Ft0IFnAjWTAifsGBN5ZPFZy5n4bF09Cn58NhAESkmsnQrkkPTc2bJ4 r7vfCAsN+0S0EYyLI8cAuui1IY5wWl/5o4OwP5YHugufP1F7A6mVQyWInOcJMsJrGdOXqsWOM a3xyobT3pr2jTx408zZxcLTmjd8CK9zeJdjjdHCAmoNzdL+vDKE8MBCYswkxUJ7U0MWXuaEzt oVid0PoKWK2bx9m/ATwgsEEq58nqRAV0isDwl87WKnDAn/f7YK85WRNPQpRshI5ynwXIWtJ7Q g+H6loco3una4ZxDrJLNejE4JdMXkILb9aaWt7hLtHBGKbJuq4cdEKXpC8f5HjpInfEVRafcm OAQhTWj1kOLUGg9qus5vyj41/pIgTcm3GbDpQjtW5NuJdLL4C0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring 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 --- 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