Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp886619yba; Thu, 18 Apr 2019 11:12:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV5PehX2efl3jNgBAO3JBbLZ/MhPxPVuxu8G/z15JqXqF/yy42lD7jPLDmAvOP/epHH5cq X-Received: by 2002:a62:ac08:: with SMTP id v8mr96820150pfe.42.1555611167699; Thu, 18 Apr 2019 11:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611167; cv=none; d=google.com; s=arc-20160816; b=GCPJAtcia1CgMUcXp3cPiC22UrUMcqlpRp9U5UPleWhLEiV/dgkvPf6nMsqx7X6I57 FfRWV7c7ePdZ3a5uUaAKnKXATkhnyZaNAM/EchrFHqWZCbmC62PaoNEDXdFpDtPFYL+m gCg4xyAyVsManCWoSkez+/q1aVqm8jYJCaPTzw7Jbc363SBkWxn0FPW8uLAWDaE/QU1t 9xUDP0sYt0XQreuZ2rIAs65bFojCROrc8cs3oOqOasBd5438FaNFSDD3FQYyAsPs1wHE 5Yu++hsFwzH8y5cvZFUwUgXcw68ZGwl0Ptnkldnzb9Sgfs7vvxxolc1SOc33+pBar8Oj qfeQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5M8S0UX0weP4RPF1zxSwaY8HBAOd5L7HYnvbK+YAzSs=; b=ByZgiapxZXe186+TBVUQm/RhtBtXLIeHW4IQIYBQe31USZC/AZYmESV0BwtjxvPX8e 7QGp/Fb9uCN6rVMzZNHzSi0lozvwtELSFVWHyryaOnNKVZFeSQCcwuDYiBx35GGEUvFW OP0Tldz9TyFrFkDLBexLT+9rYAuxAGscmXHHIOeL+Lbkcc+DIENULOF0tyYfCcsKqiFw kVhbZm4726elrfwTyqMiEBevRbDfW3aNy2+cMHC5pYi0NipzS1tvR9c1pu2xqHxONf/P f0Hf/3WiR7Moh0LKRZ4WuljAbev05ZpIWWVLJz2uHrtMPsqtainC+hhXrblwtDjRliz/ nbjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rl52wMDP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si2729244plq.2.2019.04.18.11.12.32; Thu, 18 Apr 2019 11:12:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rl52wMDP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404193AbfDRSKw (ORCPT + 99 others); Thu, 18 Apr 2019 14:10:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:42752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403870AbfDRSKt (ORCPT ); Thu, 18 Apr 2019 14:10:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4055B218AE; Thu, 18 Apr 2019 18:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611048; bh=VqlPx26gYG/Kz7tJvElCH3R3HKtZqAYIL8cnZmXJpbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rl52wMDPP35GqcVX87rs1ct2nH4FDZ3qhYweJb17Vzjshcd/JqvCpW3NkLQoBd58m UYuHLT22km83vtnHScJfkQ23DWmN6kdJ7IxDYq9+vqspUpAbr912YwETN+wSKmhwmm hEK8OHG9rHHk/J0fNXyVGplRfN7/HF57i6GMAdzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Namhyung Kim , Peter Zijlstra , "Steven Rostedt (VMware)" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.0 40/93] perf top: Fix error handling in cmd_top() Date: Thu, 18 Apr 2019 19:57:18 +0200 Message-Id: <20190418160441.470647906@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 70c819e4bf1c5f492768b399d898d458ccdad2b6 ] We should go to the cleanup path, to avoid leaks, detected using gcc's ASan. Signed-off-by: Changbin Du Reviewed-by: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Link: http://lkml.kernel.org/r/20190316080556.3075-9-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/builtin-top.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 9b215007924b..369a3daca1eb 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1622,8 +1622,9 @@ int cmd_top(int argc, const char **argv) annotation_config__init(); symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); - if (symbol__init(NULL) < 0) - return -1; + status = symbol__init(NULL); + if (status < 0) + goto out_delete_evlist; sort__setup_elide(stdout); -- 2.19.1