Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4483552ybx; Mon, 4 Nov 2019 14:11:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzlhQMfZ+i1jGrtmoz4LUB3qlMXrDoT1kHObneHxOgX5FGGaVJTeHYKvKSsfVkwLCjdhMVy X-Received: by 2002:a17:906:a986:: with SMTP id jr6mr26234327ejb.158.1572905464377; Mon, 04 Nov 2019 14:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905464; cv=none; d=google.com; s=arc-20160816; b=Hqukbi5+1Wsxh986X0xqQRJu+09oJVDqhmqjUWoqXKDV8PMBHtHr+LOFn7//gsir2k BXJY8gInccSxdZfD8CLv33BkarV/JdB0Z82Tka0LgpThraUFIib6YI2lLOe1cTjlAYQ3 5euk1nbBZRYwWERWjYNv3VXqEboo11SteczbdS4HEVMBrv9j/jwEot7pPYSj7t2ZPLpW scTReu6M5ucGWDvchtETI2yasTR1f1egauH6G0dC2KkwSsjm0s0vmETIVAEbpoDVm4eS BnSHMK3NnZfw7FvpuWiyKahmgXgOyIpuGM2maukl8NFEmlj0XzzQ1+toYSTKtlLZayWo gp1g== 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=YCnE11439zVaKX5PdNigbbcQnxvwoT1LsJrJ3U1VyMw=; b=ERtQzn9Fvj3MvFRHugaSiEiag55Cp2w/lHzzhA0FAQ2rV7EaaBsMiLDsaJCYULAl+1 WpMa2d8BEv3ebIVHVwV9C8IA5yWRrPEVLo4ezq81PFiDAcF8S7Hd+uwxew/ImffTL16n I01k69vPuJJbGfFYdjj/UQ8sU2Va7KEpdLMYkkNWL4Qk5sDTmWsuWqFB7FVxLHpLc+PL yHnd8nBy4Ij1iro+uSEh4INPoI6K2X9uy8mhIbrt+ZwJH0+POs2VjLKzqN0PwxaFYyrN oTnq3thvbjl6SMcNnt2QIOpTOcLo0pE92tDJTpueFGXfxCzWfLAgYuAcEKcOvTGbKA11 Z1+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0k4s4jkT; 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 y11si9285574edd.182.2019.11.04.14.10.40; Mon, 04 Nov 2019 14:11:04 -0800 (PST) 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=0k4s4jkT; 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 S2389734AbfKDWHn (ORCPT + 99 others); Mon, 4 Nov 2019 17:07:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:40298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388225AbfKDWHl (ORCPT ); Mon, 4 Nov 2019 17:07:41 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (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 7CBA7214D9; Mon, 4 Nov 2019 22:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905260; bh=7sswNqk+vSRcaPxXaAyNYYTr8uidR7ZgpcGDrKXJKns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0k4s4jkTEEy86MabToV+PKNkS47fleUgaSz9ZxYv8vL4RA32SnEIV3LX/qODjVn7j MV9J9gh76YX5vnMWcj3VUpnMj+RF8PPWWaRNnejfibzHSn2lmnADR4hNR6RVhbhaqj TYht4P4h1myny3lN55hN3VbaR1ywOyFOr8W4POfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Jiri Olsa , Alexander Shishkin , Mark Rutland , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.3 083/163] perf annotate: Fix multiple memory and file descriptor leaks Date: Mon, 4 Nov 2019 22:44:33 +0100 Message-Id: <20191104212146.297059666@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@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 From: Gustavo A. R. Silva [ Upstream commit f948eb45e3af9fb18a0487d0797a773897ef6929 ] Store SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF in variable *ret*, instead of returning in the middle of the function and leaking multiple resources: prog_linfo, btf, s and bfdf. Addresses-Coverity-ID: 1454832 ("Structurally dead code") Fixes: 11aad897f6d1 ("perf annotate: Don't return -1 for error when doing BPF disassembly") Signed-off-by: Gustavo A. R. Silva Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20191014171047.GA30850@embeddedor Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/annotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index fb8756026a805..2e02d2a0176a8 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1752,7 +1752,7 @@ static int symbol__disassemble_bpf(struct symbol *sym, info_node = perf_env__find_bpf_prog_info(dso->bpf_prog.env, dso->bpf_prog.id); if (!info_node) { - return SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF; + ret = SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF; goto out; } info_linear = info_node->info_linear; -- 2.20.1