Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1337895pxb; Fri, 22 Jan 2021 13:06:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsryv1f28QFJTmq6/zE0L5wmKHb9/tKzPXUsdX0yYOSJw81qZzjYatLAISb0Mf3/eWbGF4 X-Received: by 2002:a17:906:28d6:: with SMTP id p22mr4214116ejd.365.1611349618065; Fri, 22 Jan 2021 13:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611349618; cv=none; d=google.com; s=arc-20160816; b=A1b2bZzbvv3FrK4w0UNtMBeVnBqwG8K+xNPIiOKKaXiSgnGJpI9tUnqls4Jx9j7KrQ m8GNn8o1WdXQPUxX4vAMRW0ACMSF83zhDJp9abMQg7WLNGAzNfCsC9fBcI4G+8HtuOHx rmvIJ/TYfiH+Z4bfkV7qD0xTdjO1/ZsyYMQu7SwDYJdZn9YVuTk4s744K+ooFqpyo1z8 OARAcnI3HoCNWvJDGazFMvA8PA0wT3sk1EYly04mtta2VcDyug8JVPXTH5bbKzaln6De /DqH4yoj34ETgzBC6Em1i6MIxuEKGyHs2Xvqvy7Kk49jDRBCGsfwUMk2QS4LcDCd92Lp YpLA== 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=j3LanT4isv8bJWkgpjrmEYnNsQlu/ohik4RXRoosJNY=; b=UpiTSTpundxgf1ZTdVhCneC43JxB94+HDO9gvjNB49VCFx1lcPUqqjskRtTbsRBGDK C5Xi4ZL9NbZ8zrqV06y3zdNYf7NNcmB4Gdkmqn/prJNj25fjc6QD/QbBWVFXq1aKUYBb 4fzhZzi6gillfgmoXXg8rHIVLPDwLWVjTqZmnjBEKw6spIRIunuzi/OkVhqqG3Fok0xW 7twrdMruKfxfyZE7SRPZaFHnM24RRyqEyJpJIOqVWQcHR8twI9OwERcIOU8SpANbRB+f c123WBwLy2Uxa+QwkKLwUkl4YSr34JdnTqx5/aT7zVIJlheoLjKEte8T7CI5v3Q3e1xj NPJg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si3841378edc.537.2021.01.22.13.06.33; Fri, 22 Jan 2021 13:06:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730555AbhAVVDW (ORCPT + 99 others); Fri, 22 Jan 2021 16:03:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:48994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728105AbhAVVBx (ORCPT ); Fri, 22 Jan 2021 16:01:53 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A8C423B16; Fri, 22 Jan 2021 21:00:53 +0000 (UTC) Date: Fri, 22 Jan 2021 16:00:52 -0500 From: Steven Rostedt To: Tom Zanussi Cc: axelrasmussen@google.com, mhiramat@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 2/6] tracing: Rework synthetic event command parsing Message-ID: <20210122160052.4b535511@gandalf.local.home> In-Reply-To: References: 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-kernel@vger.kernel.org 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. -- 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;