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 F3AA8EB64DC for ; Sat, 15 Jul 2023 13:42:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjGONmH (ORCPT ); Sat, 15 Jul 2023 09:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjGONmG (ORCPT ); Sat, 15 Jul 2023 09:42:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC092700; Sat, 15 Jul 2023 06:42:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2AD8D60B86; Sat, 15 Jul 2023 13:42:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 418A1C433C8; Sat, 15 Jul 2023 13:42:03 +0000 (UTC) Date: Sat, 15 Jul 2023 09:42:01 -0400 From: Steven Rostedt To: Zheng Yejian Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mark Rutland Subject: Re: [PATCH 2/2] tracing: Add free_trace_iter_content() helper function Message-ID: <20230715094201.34a41f17@rorschach.local.home> In-Reply-To: References: <20230713114510.04c452ca@gandalf.local.home> <20230713114700.450e7a17@gandalf.local.home> 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 Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Sat, 15 Jul 2023 13:15:32 +0800 Zheng Yejian wrote: > > @@ -6709,7 +6723,12 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) > > } > > > > trace_seq_init(&iter->seq); > > - iter->trace = tr->current_trace; > > + > > + iter->trace = kzalloc(sizeof(*iter->trace), GFP_KERNEL); > > + if (!iter->trace) > > + goto fail; > > Hi, Steve, 'ret' may need to be set before `goto fail`: > ret = -ENOMEM; > As I mentioned to Masami, this hunk of the patch didn't belong. Something got mixed up in the commit. This patch even depends on the previous patch to remove the allocation completely. -- Steve