Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp689804pxv; Thu, 15 Jul 2021 13:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaCxYi1P26DbYXzEHw8N9WWGDNAYOytq1mHlcw0nY8uPe2404m2LxhZ2y/IxHW8OneLiTQ X-Received: by 2002:a17:906:b0c1:: with SMTP id bk1mr7478127ejb.202.1626381198414; Thu, 15 Jul 2021 13:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626381198; cv=none; d=google.com; s=arc-20160816; b=Qg/dRt2XOpXEEB+VMzNvX2HBVEBquBYaVBLwsTVsF45f9vchCRaY8A0jvyVr2Pl1KQ /03yOgdK8rC2/qgHj+y1SG4g1RLkVo6dhtuRiQHLLdVtWaEgHB16gcmhdq3sZ1bUZmXn jLQbA4g1hHc84IVBb/b+xCtUaz6D3SIYBKoSbtCW1sVKb8pg2p1tYVCJTsV3UTSMmINB Oq3fHdRIgjHhfmPl+lcP0t9d5t3oOH9rHbWbws1Rr/BRv0sBLwAkwWckrfld1YfwSfue y4T76hSTGTrhfOR6JirTyMrlwE8nMTdIo29fuBHltJmT0iD9NmdGaDhusPg1jQCCZpC3 MMsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yy2mJzI5qeWxRXRBSzS2uB1gyrEaEEtN9b1wWmiBsx8=; b=KPR6TckrY+NROvHuNfqcL8Bh4X4bWsU6iLtzA1yF266KldpdGxbWQb+I6UcVW7G6Do xubQlixoAu4/CMimaUxzJPUHhOzdEif43TlKQLATaMvu5OvQs/RnJ2oTyRznWgFtdJQ1 1uy2mA25JZknrwGqGAcebQajIN+Yx1OdWJmUbvkwVbrtObkliBubI7dt7sRxCH961mS+ B2ZwgM/aeRdIFhKz/N9+yRGveDXZhcHPKe2KR9Hlv6onETwCKRs2UDByd4ApF0p+F26x Gvx7kf2ij4qKv5WsQZidGuJGY5+k0wvYTuPYbyijQhx29mYXqntY1BSVSf9hYHnAQmeu Oi9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nKd4Vn3E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq5si8519390edb.416.2021.07.15.13.32.55; Thu, 15 Jul 2021 13:33:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nKd4Vn3E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236182AbhGOUeE (ORCPT + 99 others); Thu, 15 Jul 2021 16:34:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235562AbhGOUeB (ORCPT ); Thu, 15 Jul 2021 16:34:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16E6D613D9; Thu, 15 Jul 2021 20:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626381068; bh=D8iIjq9U2XEFr/hbdrVDkVdZ7qoyKY+1QmdzD+wWDeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nKd4Vn3EySbupuKBcpLik0cbPh+D0tFpaPyXYJT2Vlq2iB0sGK+7FP8tXNvIIfeEs gbWtm3l83sRuMxkpKkxE7eErs7wH/77Lo9Dy3KHHYLWAlkye+4g1/98sseH7dURa0T qiNP39w/QuEdohn4MRBiK+oxo+BG6kJif1jJn+71LDEKKbOs1qMzsJxWjdYkzBgF2y sjvg3URy8RrDI8lMqNSCOpSCE5iC2/RhFxevLVeD6vjedHBumc2LVy1pgYPISFF8Jt RnrpzvjTiKy0rRp72YjomjNf8qdpBkJVMX5y0v6cEYTIGCVpju9SqXwDMoOm3vaVw8 jrgGIwuqb20/A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B0313403F2; Thu, 15 Jul 2021 17:31:05 -0300 (-03) Date: Thu, 15 Jul 2021 17:31:05 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 14/20] perf util/lzma: close lzma stream Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Jul 15, 2021 at 06:07:19PM +0200, Riccardo Mancini escreveu: > ASan reports memory leaks when running the perf test > "88: Check open filename arg using perf trace + vfs_getname". > One of these is caused by the lzma stream never being closed inside > lzma_decompress_to_file. > > This patch adds the missing lzma_end. Fixes: 80a32e5b498a7547 ("perf tools: Add lzma decompression support for kernel module") Thanks, applied. - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/util/lzma.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c > index 39062df0262915bd..51424cdc3b682c64 100644 > --- a/tools/perf/util/lzma.c > +++ b/tools/perf/util/lzma.c > @@ -69,7 +69,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) > > if (ferror(infile)) { > pr_err("lzma: read error: %s\n", strerror(errno)); > - goto err_fclose; > + goto err_lzma_end; > } > > if (feof(infile)) > @@ -83,7 +83,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) > > if (writen(output_fd, buf_out, write_size) != write_size) { > pr_err("lzma: write error: %s\n", strerror(errno)); > - goto err_fclose; > + goto err_lzma_end; > } > > strm.next_out = buf_out; > @@ -95,11 +95,13 @@ int lzma_decompress_to_file(const char *input, int output_fd) > break; > > pr_err("lzma: failed %s\n", lzma_strerror(ret)); > - goto err_fclose; > + goto err_lzma_end; > } > } > > err = 0; > +err_lzma_end: > + lzma_end(&strm); > err_fclose: > fclose(infile); > return err; > -- > 2.31.1 > -- - Arnaldo