Received: by 10.192.245.15 with SMTP id i15csp1207122imn; Sun, 11 Mar 2018 08:20:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELtWuUrWOaJf58/CStJUSZ28/J2puVbs0iNZrkcoENYgrWDZuW1m8ulenRV5fHjl26blqohN X-Received: by 10.101.101.5 with SMTP id x5mr4130986pgv.195.1520781636655; Sun, 11 Mar 2018 08:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520781636; cv=none; d=google.com; s=arc-20160816; b=Z3tmHdnX46AAZXav4k9uLZ4L60qWWKCEVDfWy95wo8V/vGOzezHBoGK8TDELMo6KNL J3cc3M20Amf+K0O2jcxeqJ+XSlnyXbI2WMLfbNeu1Zlmg7CmTibHunpP/R2vMuTNjXq7 mHvdzzSfSo42WacYK2Q2q4gjhJWkFj63V4Eg+42klW52Grw36aM2qah2uiFJBwni3IDo B8lQ7eBD2iv/6uyMgd2ocdJm9bXinsBOwx+OX8kouEcZravAup+x1BIzqSUoAsCJ9K8P fSOGhonQocXqNFsd2cWef3SvMM1UaAFV5G9u1rpkTniG7Y8+olEvzmtMtZ7LF18III59 wCtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=QStxY75ox07dm0gFHZs505Ao6qYoWtDGPiV5kkqfKcg=; b=SIdsI1mD8umyMHdaCRocS6UQeX8ViT20TldHCEZpImLiI5w7oxXtfFTJrMrBa5Q7KK PQEmPWIxNhJAy/iMpYpl3RkzT7IRY+5sPz8f9SgFHqWHukLlUTpE7hjsfxUKJ7spfof7 FXZaxP5YdpHniIKdqrG2XNq14PL9ZmjUcuYtBhnhtuDThIHbFMAQV/YNdpfpB73Fok5l mFrsWwGrf8aVID+dapMSP/QrlwrZGOGBrSi0o85x1ktt/LpV22PhMCsGiH/hSr2Civsd 5ru2Ba1hcoPCBftCMm3cXK5wkVu2QcHmhCA3fcRSjC9d3BX4oRCUQeNvjqtgQJ/0J1z9 lnZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si4555829plk.550.2018.03.11.08.20.21; Sun, 11 Mar 2018 08:20:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932277AbeCKPTX (ORCPT + 99 others); Sun, 11 Mar 2018 11:19:23 -0400 Received: from mout.web.de ([212.227.17.12]:50467 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbeCKPTV (ORCPT ); Sun, 11 Mar 2018 11:19:21 -0400 Received: from [192.168.1.2] ([77.182.27.43]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Md4pC-1fD7pn1x5e-00I9iM; Sun, 11 Mar 2018 16:19:09 +0100 Subject: [PATCH 4/9] um/drivers/vector_user: Delete an unnecessary check before kfree() in user_init_socket_fds() From: SF Markus Elfring To: user-mode-linux-devel@lists.sourceforge.net, Anton Ivanov , Jeff Dike , Richard Weinberger Cc: user-mode-linux-user@lists.sourceforge.net, kernel-janitors@vger.kernel.org, LKML References: Message-ID: <16c0e64e-01f1-4275-51cc-b56401f6f91d@users.sourceforge.net> Date: Sun, 11 Mar 2018 16:19:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:y/pO4McOpkO6HQoWvEGuPinIqAXcJsZjDg0kFdZYhif0IpoulD3 3XW384DTHhjzsNoGP6r8Qb14eMGvIQDfEYfSc5gId/ORp2Su67RkVHulqFtwrGt1DgliFV6 OqqhaXyTzodbIMCFaf7x4+VFErPiL/dHfDza5WvFdxS9bItyQP021VYHMoclcOm6v1skmJf /RP/HNwYPpCG7Z5KC682A== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZkHHzDE3kTY=:fig/FYcfL7oB7QRF/3QlDo 0u/KBDW68yKxCaxh56RnoySBuRrkDAdO+P01SI9FfdXyumPhYJwL/0EWUVMe8cE5ofa+QJMWt /RvPFxOJKRbY8OG7jCQV+BmjY+08DH0UcxRCxoGxVE2PpKu2DSaNj0fJObS/bLyf4Fyn60kbQ u9g2LrYZzkil42ig3Wo8y1fLR44rW4F1PjCvCvIbOhtw2Qj+Gh4U2+HzUOTdDoNqi8yZj0x3j kzQ0JchiR+t3EaTBtbiTXMS+ZrXmEm/Z4gMr8L58+lgssIjRU0N24B3OufMWt+CeJBpfwEJVL CWoDvPFTr1k23H6C8G4hPlrRlcp4fELahOaMcNmC5B/Zto9OqxHMAlbM9iv0X2WVBzLSZ3PHO 1SC/3yEZfGvlmIUZuAunydWmT65wnM2LDZD/PbTiPnIA6NxeNT6RNaIgx//cJzkfbfbL0vu4L 5eNB5xF5sP4Pw9ekFSU3VSHWl0wWSvRE7SB9xw42p5SbgWzfjtPtbBDIHDIf6dvabmYOaIB57 x6UHy67Q6PlU3VX/nGIsw4aHrNsdY00EXY0stDvfTs+oAmr/IfJcI3e8sGFZAicPGhuSSt2o1 4xbtuZML2r3JB3jX6MzLB3LGVxv+qU8xfkyc+QYrmmAv8++jWkyej6Az9lT7ynY0xV9e2dTFI 3aDuXgP/vU7HlsbdW/ZBJ3RglXZ0zG+RmdasfnYZWHa7Zu1oSQNv/R4e68eEfAHGBszFu0mYM OYy93xMuDnlhPmMRlKwnFA7SoQ8YduD1YhejZXxc94+pK6oUyPvIMavhWcnr3ZRWm57022rZD 7hSYu4tJA5HpN5CAsTsybU76hFH+3wTdOS8yHttB4aL0qtLoEc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sun, 11 Mar 2018 14:00:09 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c index 9cc4651990e3..e831bd85cad4 100644 --- a/arch/um/drivers/vector_user.c +++ b/arch/um/drivers/vector_user.c @@ -422,8 +422,7 @@ static struct vector_fds *user_init_socket_fds(struct arglist *ifspec, int id) if (fd >= 0) os_close_file(fd); if (result != NULL) { - if (result->remote_addr != NULL) - kfree(result->remote_addr); + kfree(result->remote_addr); kfree(result); } -- 2.16.2