From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751143AbdHXCPp (ORCPT ); Wed, 23 Aug 2017 22:15:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbdHXCPo (ORCPT ); Wed, 23 Aug 2017 22:15:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA97221A29 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Wed, 23 Aug 2017 22:15:41 -0400 From: Steven Rostedt To: Chunyu Hu Cc: mingo@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] tracing: Fix kmemleak in set_trigger_filter Message-ID: <20170823221541.7aff7912@gandalf.local.home> In-Reply-To: <951946349.836645.1503529083300.JavaMail.zimbra@redhat.com> References: <1502705898-27571-1-git-send-email-chuhu@redhat.com> <1502705898-27571-2-git-send-email-chuhu@redhat.com> <20170823103836.584a5dc5@gandalf.local.home> <20170823104155.27f7c6f6@gandalf.local.home> <20170823125249.102d0908@gandalf.local.home> <951946349.836645.1503529083300.JavaMail.zimbra@redhat.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Aug 2017 18:58:03 -0400 (EDT) Chunyu Hu wrote: > ----- Original Message ----- > > From: "Steven Rostedt" > > To: "Chunyu Hu" > > Cc: mingo@kernel.org, linux-kernel@vger.kernel.org > > Sent: Wednesday, August 23, 2017 12:52:49 PM > > Subject: Re: [PATCH 2/2] tracing: Fix kmemleak in set_trigger_filter > > > > On Wed, 23 Aug 2017 10:41:55 -0400 > > Steven Rostedt wrote: > > > > > * On success, returns 0 and *@filterp points to the new filter. On > > > * failure, returns -errno and *@filterp may point to %NULL or to a new > > > * filter. In the latter case, the returned filter contains error > > > * information if @set_str is %true and the caller is responsible for > > > * freeing it. > > > > > > So filter contains an error string when it fails. It seems that we > > > should somehow propagate that up the chain to display. I'll look more > > > into this. > > > > The bug is in create_filter(), because "set_str" is set to false, and > > the filter should not be passed back allocated on error. > > Thanks for all the analysis. I think you are right. I'll try to have a test on it > in case we miss something. But please don't block on my test. > My tests are almost done, but I wont send anything till tomorrow. I can wait a day to post. There's a few other changes I need to send to Linus as well. -- Steve