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 2A68CC3527B for ; Tue, 5 Apr 2022 20:15:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387168AbiDEUFj (ORCPT ); Tue, 5 Apr 2022 16:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356536AbiDEKX7 (ORCPT ); Tue, 5 Apr 2022 06:23:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0390DA; Tue, 5 Apr 2022 03:08:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id A86C5B81C8A; Tue, 5 Apr 2022 10:08:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB82C385A2; Tue, 5 Apr 2022 10:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153307; bh=phw36U8LfLAByfH2Wv8qk/Z/g2xProxmP4xZfrB1lHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8e6HFOeQf1kG2+BZtvFDRMap7anaNGxYPr3Yv9IMEzDiAmrCyjqtxR5foIs8aDSw IKKIGHaMDp6Roh2MsHLW/A0VVdLCXhsg7iRCsCORNf7lIHTsoFxJXbzgqOaZV9/xYn yHDgSEWDB79sU7+LX+rtb9Ss5XuNmBSwi2FzFYtQ= 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.10 177/599] perf/core: Fix address filter parser for multiple filters Date: Tue, 5 Apr 2022 09:27:51 +0200 Message-Id: <20220405070304.109432125@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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 c8b3f94f0dbb..79d8b27cf2fc 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -10265,8 +10265,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