Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1075419imw; Fri, 8 Jul 2022 18:18:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRDQQbXaiW7Y6PRE62y6IhweXbE207SUAp5oXOsZCYSnpk8ZAwSJ9Vw//cMYXlGJxufk7R X-Received: by 2002:a17:902:bf01:b0:16b:e24e:1d2f with SMTP id bi1-20020a170902bf0100b0016be24e1d2fmr6667429plb.46.1657329496057; Fri, 08 Jul 2022 18:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657329496; cv=none; d=google.com; s=arc-20160816; b=qZ74YIAbIomf+3vQAoeRJEZsNS2BW1ySeqxccLEiE7LfmckDDqeiuD9rFRXuFUy9KH FelAISZ5YMUwO4vKi97CNbVr9fWrnsimhIMRwsMPgxCKjDNkNoZnU9t/4AlEdtTswEY3 UfpZ2wypt3uUFDgoMNKJLHobQd7TkSN639omHG25Cv1HmtS6XKrGzhrQwCj0/x3/b/VA gu13BOzpqulg/utSxdoZkU8b+q0IOSRgl4GDDosAwbnGxuNJIrns+CRcPL8Ec5KIenh8 2JDBz4KZCcXPA5IEsMRAKcjQgOiTR7nApLrYIqsN3tH5xTnJu7N17e0YI5SHFBopp/D4 R91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=U+hrkvsS6fmRq0TSd2b4BekXyHXATWtrJbmWZayAIsM=; b=PZ0Sk0efHAl3PNJ+K7lKGKqyEFIDJZwKqNXum+XmOWEvZM1hOTo1JvcR4xKlb/cfOn /cbKrAZq0SvdveM5uZT4Kgzk9tHIHQUKNsG9LoHq7WTqtncl3eMC3J+IX/i/MA8uPiez 8z41FoOis+dqnRMHpZU5ywyU6kId1GehBbAO5gOn+FNaHIOJJKmG45YcbsNoxreDGkC+ qSKOWLif0Zr0bGHwIs/SPLggG0uTGU5qzUDWK/7palaoaUW+HamPRRq2yFL8FR5ZxH3r Og7J+lpQhGkkDIiQLTtHEPT/L+rg0b1eQ3oY7WORmmD7+KAj7xMs6rOJ1YL8bOy4dFmA xOsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my18-20020a17090b4c9200b001ecb608ea41si5290151pjb.167.2022.07.08.18.18.03; Fri, 08 Jul 2022 18:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229441AbiGIBDr (ORCPT + 99 others); Fri, 8 Jul 2022 21:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbiGIBDl (ORCPT ); Fri, 8 Jul 2022 21:03:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02C52C64D; Fri, 8 Jul 2022 18:03:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7850B623EE; Sat, 9 Jul 2022 01:03:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14ACAC341CA; Sat, 9 Jul 2022 01:03:36 +0000 (UTC) Date: Fri, 8 Jul 2022 21:03:35 -0400 From: Steven Rostedt To: Zheng Yejian Cc: , , , , , Subject: Re: [PATCH] Revert "tracing: fix double free" Message-ID: <20220708210335.79a38356@gandalf.local.home> In-Reply-To: <20220630013137.164756-1-zhengyejian1@huawei.com> References: <20220630013137.164756-1-zhengyejian1@huawei.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Jun 2022 09:31:37 +0800 Zheng Yejian wrote: > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 48e82e141d54..2784951e0fc8 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -4430,6 +4430,7 @@ static int parse_var_defs(struct hist_trigger_data *hist_data) > > s = kstrdup(field_str, GFP_KERNEL); > if (!s) { > + kfree(hist_data->attrs->var_defs.name[n_vars]); Instead of doing just a revert, can we also add, for safety: hist_data->attrs->var_defs.name[n_vars] = NULL; Thanks, -- Steve > ret = -ENOMEM; > goto free; > }