Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp915763ybe; Fri, 13 Sep 2019 08:16:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyTNLGxwuR9uchLxQIDgqUE3YUFIuv/p13vPdHyq4Cihah1vv+GHeptnKaivL9oOy/Qf+Z X-Received: by 2002:a05:6402:b04:: with SMTP id bm4mr48958176edb.196.1568387807471; Fri, 13 Sep 2019 08:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568387807; cv=none; d=google.com; s=arc-20160816; b=PNju40E5C4LSD8VnNrUOt14fHM+x+U4PiKdF8Sa/VCXn+b4TguAG0F7O+TaAJE6mQw ryOpftyz1zxRAv8XZQUuMqKzBMqrUm4YZY0Pk8DTAuNGKobEaHKX35vd3sYdZSwDsXvW mRtj9ViI4KAyXrkmtR8dJGEkQorFutQ/y0Xf4cRczeXDX086k0V8do+pxHsAh00egRZW 4cJGNRMVZ+1S+xuD6aQ/xIDHty+HdEzxfBwXD/GcC6ohyiF5umrUoJrbUmvh7cwm4KkT FOps/Sh5bkZDhdC/WWumpY4rnPxm8ZqCekXU5+T7SAelVvW62DvLDY3lXGpAeamyH7N+ dC5g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7StRYsJz9ksGp7G12cgj6rUEB6sFkkZDPX+TvreRKYc=; b=sIgNcDetvQtd3G3Yu2OKhHK7Q3I170xtZp5VUTU6m5wUV8ucRRPQHIK/tB+0VHrVMY kieON+7EawEHAeaYBGepN1+/Akj1gjrFmv4Jiwohoh8JVfi6ozTjTHMj3iAwiS70Jl0q gbJwdf8BpSKmefcAO8IF1CXNakUMeUZ/NOySLMz+YLYUsSG/XThopW8J3AmExv4ufAZH 6So2yHFCvImUm8ZtiuMJsOiPfP3/JzutD04CA/CWcmOQgyQstE6ZB900sBkDmvVKhJB7 37wjyAahYD3+WkgoEJUJwHkRKN/fiuDH/uCeYocz98R9oRM082o6GJuIeZnnOaOZnMos 4aiA== 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si9570830ejd.212.2019.09.13.08.16.23; Fri, 13 Sep 2019 08:16: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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391569AbfIMN0f (ORCPT + 99 others); Fri, 13 Sep 2019 09:26:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390232AbfIMN0d (ORCPT ); Fri, 13 Sep 2019 09:26:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 769E151EE6; Fri, 13 Sep 2019 13:26:33 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id D32005C219; Fri, 13 Sep 2019 13:26:31 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 64/73] libperf: Call perf_evlist__munmap/close on perf_evlist__delete Date: Fri, 13 Sep 2019 15:23:46 +0200 Message-Id: <20190913132355.21634-65-jolsa@kernel.org> In-Reply-To: <20190913132355.21634-1-jolsa@kernel.org> References: <20190913132355.21634-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 13 Sep 2019 13:26:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let perf_evlist__delete do all the necessary cleanup. All the cleanup functions check if the their data is created before cleaning it up, so it's ok to call any of them separately before perf_evlist__delete. Link: http://lkml.kernel.org/n/tip-9l1dsswu6rkejfbjg9zm4dld@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/evlist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index 1c8a9e283adc..8920833afa9e 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -132,6 +132,11 @@ void perf_evlist__exit(struct perf_evlist *evlist) void perf_evlist__delete(struct perf_evlist *evlist) { + if (evlist == NULL) + return; + + perf_evlist__munmap(evlist); + perf_evlist__close(evlist); perf_evlist__purge(evlist); perf_evlist__exit(evlist); free(evlist); -- 2.21.0