Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3159663pxb; Mon, 25 Jan 2021 08:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRObYW21pyDk5P1BhpA+Yh4RwTV+oOWNYwZE2+FjdonA+ixFpHQCfOZrMY76si0K+A/Zb9 X-Received: by 2002:a17:906:b055:: with SMTP id bj21mr882294ejb.355.1611591962552; Mon, 25 Jan 2021 08:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611591962; cv=none; d=google.com; s=arc-20160816; b=0WqnNErPxzq4ztfozgXt27pKaS8Ob8LhDTVpxzYYS42lVo31BJo4pUpJPDgy2ffWMI eyQvXYTugjkGJoe//rSagEvNWXOI+jstiBCfBUMiOeYHgkRR0yex/Fl3sUR+uOyGR3co 6QQofzWFqXUfk8ybv5xw6K7mUg9ePAEKJb3xml4goPaBFHNjuroIAVuaBsvr+NC4k9Hz Lcum2kYcIw4/10gkl9CiSThHlxLLUd8v+RsYPAhOK0Rvr2fAEpZQ6x0x+a+RcqKu9cHe huOQezLNbiMJ8HE5p3N6WFCB/Hak70EshdPHhSfPbDKXsO0SrJ6tAzePyfbVs8gAXYLF 4klQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=U/C1AdyGF/uQn7I8hh7LZcOjvBJALAVUEEU/bpkSk8U=; b=Ps0/CCe1irFZ1iOSBdY0KOIDwJ5B+WlE052iuYCCbkp39wbU0ZhkeenRLcjnoZO8yT pJ9Ls1f9R+BvPC8F8fUGoZvhVNTYbyWToDL53HjcLE9fdkIBMoIMAT3ygNh6tvA4LT34 2jWmpuM4bjD01FF7VTyCf6LYtwZlS2mABqTf6Px7Fng/+yhnjRJUKQtkWPSAaCkTFYY2 DJMDyFgWF6KsiQEcZ17UYmnFTryNF11s7FM2R9VFGPK89FRwANWmtC5uUHGyFmNWrz5O xBbLzDmw1c2yD9kAi5i/w/owc2KZSkqpXLMokSv0rmHykmaqiW35jJHiNUWCz9EQZZHc 85fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NsuEGi6H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si6043913ejv.263.2021.01.25.08.25.36; Mon, 25 Jan 2021 08:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NsuEGi6H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730724AbhAYQX0 (ORCPT + 99 others); Mon, 25 Jan 2021 11:23:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:45162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730654AbhAYQWv (ORCPT ); Mon, 25 Jan 2021 11:22:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37A1A206DC; Mon, 25 Jan 2021 16:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611591729; bh=jjDQ2s0twTYbDW/MrsqbUCMxfOdavt2PC/vVMg9dDIY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=NsuEGi6Huh4mL18fICoNaKMa9cGxpqvZIIN9rZbm1PGENLW3tj2AveO0C06m/wnEO zQzx+7ND6OpTj9VknPEXKKG9Ow6715lTh5o0JPUMRxPcNmCNCw5GiB061xhmZ8e5vh pz575lg8cO8sqLIvUJBQmyeXYZwCiUSpCoxKN0QS0zfuGaMnJyFq+Nt/mqCq9K7uXK 3JOhdp9PisjZdftOKBIPnHl/EMCrTLegOqZ5AsDtGQT4W0stm+hGjBOQhQXkUFlbFK hNeXi+ibMZHQiSa9zd3QBaRzG2XbThC1kdMaTMO0zeeW3jStuhCKICAirM1Zz7lwxg n/DTcKxkl8/fA== Message-ID: <91c81c68e183f3aaa5c982c5741710788413f0db.camel@kernel.org> Subject: Re: [PATCH v6 2/6] tracing: Rework synthetic event command parsing From: Tom Zanussi To: Steven Rostedt Cc: axelrasmussen@google.com, mhiramat@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org Date: Mon, 25 Jan 2021 10:22:07 -0600 In-Reply-To: <20210122160052.4b535511@gandalf.local.home> References: <20210122160052.4b535511@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On Fri, 2021-01-22 at 16:00 -0500, Steven Rostedt wrote: > On Thu, 21 Jan 2021 11:01:05 -0600 > Tom Zanussi wrote: > > > @@ -1208,13 +1173,14 @@ static int __create_synth_event(int argc, > > const char *name, const char **argv) > > * where 'field' = type field_name > > */ > > > > - if (name[0] == '\0' || argc < 1) { > > + mutex_lock(&event_mutex); > > I'm curious, why is the event_mutex taken here? I'm guessing it is > first > needed for the find_synth_event() call, in which case, it can be > moved > after the is_good_name() check. I don't see why the goto out is > required > here or for the is_good_name() check. > Yes, it's for the find_synth_event() call, and yes, it should come after the is_good_name() check. I'll move it and fix up the goto changes as a result. Thanks, Tom > -- Steve > > > + > > + if (name[0] == '\0') { > > synth_err(SYNTH_ERR_CMD_INCOMPLETE, 0); > > - return -EINVAL; > > + ret = -EINVAL; > > + goto out; > > } > > > > - mutex_lock(&event_mutex); > > - > > if (!is_good_name(name)) { > > synth_err(SYNTH_ERR_BAD_NAME, errpos(name)); > > ret = -EINVAL;