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 3A7ACC433FE for ; Sat, 12 Mar 2022 13:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbiCLNth (ORCPT ); Sat, 12 Mar 2022 08:49:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbiCLNth (ORCPT ); Sat, 12 Mar 2022 08:49:37 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F66043ED7; Sat, 12 Mar 2022 05:48:31 -0800 (PST) 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 7F113B803F3; Sat, 12 Mar 2022 13:48:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CC86C340EB; Sat, 12 Mar 2022 13:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647092909; bh=x3ngDXRTNxQtTUJ2tAIPdh6UG49UoIpaL6SxIce4GXo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ndaIzAlDCK5DV6QonZCCsR+Pk2vhz4Q4FLdLUjZaIEPYUbTz2kAnp84WGLruKqIy7 QIX5nuaQdK1xbmBUNlGq87dvUd8Z93vzKriNBq7UEdJsvDRyn//JiKyDEuO1rCWs8J PIMuNclNJeXP10VuJ5b0tMkoIf82H5CgWClAcI2tDN6pK8+cHmhq6ugWV7Uou1UAsW PBvGJyumGl7APHq6rwbNK9qxQ8VCJQbfFkxHP6HhUHMSEf/Cx8mgzR9f0FHS12qtWR cM5fTUpU40cOzgkTeb7QphruAAY/TDs/sq+qHUu8hc0LeMk+S/Uq+xhqzsnVbdWNHB I2ff9VBcYTkpw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 78EB9403C8; Sat, 12 Mar 2022 10:48:26 -0300 (-03) Date: Sat, 12 Mar 2022 10:48:26 -0300 From: Arnaldo Carvalho de Melo To: John Garry Cc: Weiguo Li , peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf parse-events: Fix null check 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-perf-users@vger.kernel.org Em Fri, Mar 11, 2022 at 02:00:13PM +0000, John Garry escreveu: > On 11/03/2022 13:06, Weiguo Li wrote: > > We did a null check after "tmp->symbol = strdup(...)", but we checked > > "list->symbol" other than "tmp->symbol". > > > > Signed-off-by: Weiguo Li > > Reviewed-by: John Garry Thanks, applied. - Arnaldo > > --- > > tools/perf/util/parse-events.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c > > index 9739b05b999e..dfb50a5f83d0 100644 > > --- a/tools/perf/util/parse-events.c > > +++ b/tools/perf/util/parse-events.c > > @@ -2193,7 +2193,7 @@ int perf_pmu__test_parse_init(void) > > for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) { > > tmp->type = symbols[i].type; > > tmp->symbol = strdup(symbols[i].symbol); > > - if (!list->symbol) > > + if (!tmp->symbol) > > goto err_free; > > } -- - Arnaldo