Received: by 10.192.245.15 with SMTP id i15csp1206322imn; Sun, 11 Mar 2018 08:18:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELsN/uO9plqpNJtu7x0r0J1OwWs2+cB/YYjadHZ4Hr/RZBHAQyC1B95MzRB55snVw1zOF7up X-Received: by 10.99.140.85 with SMTP id q21mr4131857pgn.51.1520781482138; Sun, 11 Mar 2018 08:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520781482; cv=none; d=google.com; s=arc-20160816; b=hsa508BGMlkP1LtGi35Gg+Fh/gmtcwI/0G46ekWUmO26r1lE0J1PrpcExCULuHlNd5 tD3cN+MVEKlrEzcIQ5FmeUSMMc7kabnDgynuHOl24zLXJm9NZ6q5nF6FwuzJxVQhgJgn Kk9CRY/jSy1h6X2N6oybSCSIpwwg81CBCCHaT7zoaEAzuFFXzu9sAb7lLLw6iL6KU058 FQtqv4wTZtOyVkDHrJATFTHLEdLXDHqBXu57aKUTT5KnLfo7LMz6E3JKMayc9GwbfzAX WhLlqC2huwTl8Q3KYvss2YjbaMP471cYWBOvwrUTUSbFE19FW++/d66baGf6ohWVJ/Zn fu7A== 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=xTPjcRC49sqLJUftsYULo8vNlH8KzAiO6Gd8UqbECNA=; b=Z/6zzq/Q1iaGbELOaRQSjMpcKCg+ecSVTF6OyIMvhj0/76J02+aN97JuTpqEe2t63z Yp0WD38uJe/8mRE/nYiPHypF1D+fhtlcGZDXFR4zElkHHSWMlvm8kmUIyqFgFwe4vn5K pmC/Bl9Ct/976qg4PqAMH/3kgR4uj8JIcwtccI8L1zSGTVVgZuW8ERc0tDoxhtqcc+Yu fDlfI7Qb/y/c4X4tkBVsWODSBVza/dkj2iKgTvDGdZjsPyOaGi8/ANVu3mKbCrsFAfAd aVnMgTXT2znUxTBZqxRKt1+ofGFbQnUhA56MGiKWoz4+i1wsp/ZZ+l0ByI81jVoOgTuO 8bVQ== 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 b12-v6si1290044plk.189.2018.03.11.08.17.47; Sun, 11 Mar 2018 08:18:02 -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 S932219AbeCKPQe (ORCPT + 99 others); Sun, 11 Mar 2018 11:16:34 -0400 Received: from mout.web.de ([212.227.17.12]:55611 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932118AbeCKPQc (ORCPT ); Sun, 11 Mar 2018 11:16:32 -0400 Received: from [192.168.1.2] ([77.182.27.43]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MWj2N-1fAh5z3M55-00Xt6g; Sun, 11 Mar 2018 16:16:20 +0100 Subject: [PATCH 1/9] um/drivers/vector_user: Delete unnecessary code in user_init_raw_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: Date: Sun, 11 Mar 2018 16:16:20 +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:+J5lgW8tPCShh8+PC1Di65e017cePu6h7fCBuGGrOyB+8i/SzcN x+HCDA5nMHZKEY6W3ovyL8ksFxrUmX48bvGwePRsvRuVoBJdTOMm4GSmU/5FH1sZlbBrmBi FrPKx27DmpYuwCWS51henM+Rm3/MjyKGXatsJnoYxOTUj8uHFBWpDSG5ofJLVgSaNDFMR74 Yp0Dv79eMUjQa9/DF1zrw== X-UI-Out-Filterresults: notjunk:1;V01:K0:LSfaxyr6pso=:8c2sJ0wOuFdNnP7Wfeqfeo kK47/TxL7lejg7HoRuoNO7MmT4gokjh6Fmu72DI5NtyRiMEfg7+/f4iQGSwToFRDryuzvtYxl XPmrORyCMoc0teuBOf3QjBsojeBkUZjVznXvKmznTF+q3kOnNe85qjVEfhb9J6CvxMYsAlj4A MKYgxtax22gviLMFlxsglyom9LyK7yPIUiOr36DRZjF5DBCC042Z/N41ZQqnC2uwMSQuYQy1F zWsJOR1lpGWtlJszHXcQL/gQXxKW3Wykdy/LNV5tEt2FXzJqzD7fYNxQfJP7fvRi4b/LPCN1M 7MLfOEgnNlxkhQUYdkKLBXyxCelI6O5kWfP2pfWmjGb2GokwB3+BOrTtNEprvVzCDNtmp+6Z9 NGLkF7SOP470Ul2Z5l9aG+lx2b9FxCFi6npYCsnP6fe+cs+ErogFIyrX9c+C55TlPVFKj4WI4 fYjm94YTDQORP23IPSOWy5NFHEOF+eSfu1bBIfxUoPNUQ2BCz9Icm7ijs4DyIuDQvCIpTVfF/ DJy0QA+kLwCl0Q1wolD5MT5beOub4AEpnfc8q2HlNdik9t2lJ/25y3UXHPdcoCSAm1BoZliWL /m7X4X3ib7Esbp8sWMigkk9642XorbNMyXIahmLnge0XpH5ve0Q4izTWKBTTk62nzLIu+NEVp 2iE3b3Ue98OZ8YPMSgZuMuRLyQdn31V2Znwa4kcOgab8iYJrT6WK83juRCT3/aOKEA/TB4uT+ 7w9ndg4M9l3fl8GCGc+K98H5AByH8/85Tm91kkAXfZLQRWrc51AsfIafBhExhzHioA9zF+996 I63JTHwZpTuv1K0YKzxgLZSzjrHzUjJRU+RnxrShVLFwJL3FGc= 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 11:36:18 +0100 * One condition check could never be reached with a non-null pointer at the end of this function. Thus remove the corresponding statement. * Delete an initialisation for the local variable "result" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c index 4291f1a5d342..d6a6207d4061 100644 --- a/arch/um/drivers/vector_user.c +++ b/arch/um/drivers/vector_user.c @@ -211,7 +211,7 @@ static struct vector_fds *user_init_raw_fds(struct arglist *ifspec) struct sockaddr_ll sock; int err = -ENOMEM; char *iface; - struct vector_fds *result = NULL; + struct vector_fds *result; int optval = 1; @@ -276,8 +276,6 @@ static struct vector_fds *user_init_raw_fds(struct arglist *ifspec) os_close_file(rxfd); if (txfd >= 0) os_close_file(txfd); - if (result != NULL) - kfree(result); return NULL; } -- 2.16.2