From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2AD8C43219 for ; Thu, 14 Apr 2022 14:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349466AbiDNOUV (ORCPT ); Thu, 14 Apr 2022 10:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343896AbiDNNj2 (ORCPT ); Thu, 14 Apr 2022 09:39:28 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC4635EDE6; Thu, 14 Apr 2022 06:35:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2B6C6CE296C; Thu, 14 Apr 2022 13:35:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E06FC385A1; Thu, 14 Apr 2022 13:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649943309; bh=F4x59SoSTnQxAIDTSZAESlyLeLqGltu5Lnks3p24C4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBMHiIFWcCch8iiVh9zRIPqZw7dkTQdsJusOw97NVPgyPNBGSTc6gAoz2z74corfs qQ4w7cvHTnyMReMBzOR9YEUGbVyzlCav8gfCs+jrpRjoJZpnvqi09Xn+Ate2cpUHEI juxg9l169uR1uK2NO6feAx1MizIWrACIJtJ4hBz0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 5.4 109/475] perf/core: Fix address filter parser for multiple filters Date: Thu, 14 Apr 2022 15:08:14 +0200 Message-Id: <20220414110858.203700839@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110855.141582785@linuxfoundation.org> References: <20220414110855.141582785@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter [ Upstream commit d680ff24e9e14444c63945b43a37ede7cd6958f9 ] Reset appropriate variables in the parser loop between parsing separate filters, so that they do not interfere with parsing the next filter. Fixes: 375637bc524952 ("perf/core: Introduce address range filtering") Signed-off-by: Adrian Hunter Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220131072453.2839535-4-adrian.hunter@intel.com Signed-off-by: Sasha Levin --- kernel/events/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index f720a40ccaf5..52f4a9e46704 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9490,8 +9490,11 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr, } /* ready to consume more filters */ + kfree(filename); + filename = NULL; state = IF_STATE_ACTION; filter = NULL; + kernel = 0; } } -- 2.34.1