Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp267182rwb; Thu, 11 Aug 2022 00:43:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZHy5r+dg7e1eX4vAH0vH7w5dNKyAO/qdzeYei14fNKaWz/8mWJWDAEs8JvrrO9gYhRxvR X-Received: by 2002:a05:6402:4024:b0:43d:2067:f068 with SMTP id d36-20020a056402402400b0043d2067f068mr30344188eda.258.1660203790180; Thu, 11 Aug 2022 00:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660203790; cv=none; d=google.com; s=arc-20160816; b=lYWqx0echE7OX0uDlOA2MHgn84XkqeLqi9hIEMC9Ol21W1KvyLKmXjTsRpsezwTdVi VuxPWgPXFtDhCQpCOPBLG/2KPbaI/kpl4uQ6iDYBMQL8f9OpnmT1gfm0b3b5pES/Gi3d eKVpS3Xu2yC+juln2U+uXtQ5QWxUn+bDDi5S8SIESF7Wosus+RBwWLiOjo2+J7w+mEuz Z7TqpkMXsx70LmaA6D58HAZdxUe3XxZg8S38It73bEJltjPd33AAJ4KSgjf7s3IInBGk FtI85hx4Pj0yso1U8j2ocRUSXqtUaGmOPhQgE+kZ3K11rzeHzChtW7LaWLGcfidMjPg3 WuIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7pkrbhvnV/QbSUWqoz2X/keBi7uCVIq8rknW2hVQjeo=; b=WIzGbYZTiz0lmiWHJPn+GuHld+USEtxFOUhawTiISl6AQeqUFlpcOTtCcLglJirKWN gdHc/fT70R5FVbrrAwJMrkakCy0p7G0JWJpuYQehKgJMN8LQ7WFw9Ez7J7yD0evBgLO+ 2oAV1zhg4rXYrdCqufhgg49eHpAPA8x3s4hvF04cvM0vBw43bhQORplpuSGi44zn0FYo 3r8KD83osbs2Ocw5B/AePdpdmCzQFZd6+mUxYmM8h6ojfrVK6tM6SL9YoC8Huz6lJ2iX k/wXtevc/2Cu41YsTERN3GcBKaasgzUbIrYxrqit/u6XuaSWCZOHFtR54HWsqpOQscqa LeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a4hJM03D; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg6-20020a1709072cc600b0072a7935544dsi6553792ejc.325.2022.08.11.00.42.44; Thu, 11 Aug 2022 00:43:10 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a4hJM03D; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234337AbiHKHVG (ORCPT + 99 others); Thu, 11 Aug 2022 03:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233535AbiHKHVF (ORCPT ); Thu, 11 Aug 2022 03:21:05 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B5088DE3; Thu, 11 Aug 2022 00:21:04 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-31f445bd486so164182757b3.13; Thu, 11 Aug 2022 00:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=7pkrbhvnV/QbSUWqoz2X/keBi7uCVIq8rknW2hVQjeo=; b=a4hJM03D6vxEEiIgVmwB20CYnvppjjbkLhxpLaY50J6vOflarnIZTzn/ox6wwKTJM8 f4ccdbI6uHhUeFLJowhbgzMddnByGuDD782jDA6pCdyRHWmz8VzYlrL0JIQezjiCVdLg q8MsoVeq6VnJcurjILgIzT2pXw6e7t+esGTfZGIxm7XgOBJCM/2d9X41r0b1XEwjkaob jsczyD3TSyVQ/SX1keN3eH9ghN9VD9ZOcVqKNzLBhRAEMMuvK+zdwtzcQeN5m8RgWZTa 0uoi/tpgib2b2R8rnvhFOfYjr9xOVeo54sLLUwRi/5QOhgiaWpOvRtPka4JLTb6gTwq3 g+og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=7pkrbhvnV/QbSUWqoz2X/keBi7uCVIq8rknW2hVQjeo=; b=BFvQIYGheZKOZlpu/93636CxdYYaYQgfE9czb5F9rVjzNwIBWGUqhFuTU+82UhkynV ODcz+Nw14dPaBOJmJLAB/BSQDgWM/qLQwRL/PS9iLIgN1mz0nwF5oPZR4WH3si5TRZRA NdPtvhUv3eXzgOp21YqDKxekmaVwZDLqJJnLUABY13iAIKdQU3yophcSqQr2QuOxnORQ gc8+QALhE7lrYZCgzYVjA2IU3wvRlaNx9JOKDZyv9UscpOGXRLDow4WypIJQjzoK1oXC K+MbhRDVrYmp9Jj7rd4ZvA4A/8mA/w1++9vClrWE80IPG3K3QSrEmcjfqWcWxAGwgDld mXKQ== X-Gm-Message-State: ACgBeo0GyzVypUmeIn8oK8ONHM5cAzOqbjyii9gyr0W7SNz3MJu4Fbbj jnlbA3pBimu2w5TZhFF0ytKm2qBJ/lE9DeItJRc= X-Received: by 2002:a81:8345:0:b0:323:9a15:7fd6 with SMTP id t66-20020a818345000000b003239a157fd6mr28519265ywf.104.1660202463545; Thu, 11 Aug 2022 00:21:03 -0700 (PDT) MIME-Version: 1.0 References: <20220810150921.8858-1-lukas.bulwahn@gmail.com> In-Reply-To: From: Lukas Bulwahn Date: Thu, 11 Aug 2022 09:20:52 +0200 Message-ID: Subject: Re: [PATCH] tracing: react to error return from traceprobe_parse_event_name() To: Linyu Yuan Cc: Steven Rostedt , Ingo Molnar , Masami Hiramatsu , Tom Zanussi , kernel-janitors , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, Aug 11, 2022 at 1:29 AM Linyu Yuan wrote: > > hi Lukas, > > On 8/10/2022 11:09 PM, Lukas Bulwahn wrote: > > The function traceprobe_parse_event_name() may set the first two function > > arguments to a non-null value and still return -EINVAL to indicate an > > unsuccessful completion of the function. Hence, it is not sufficient to > > just check the result of the two function arguments for being not null, > > but the return value also needs to be checked. > > > > Commit 95c104c378dc ("tracing: Auto generate event name when creating a > > group of events") changed the error-return-value checking of the second > > traceprobe_parse_event_name() invocation in __trace_eprobe_create() and > > removed checking the return value to jump to the error handling case. > > > > Reinstate using the return value in the error-return-value checking. > > > > Signed-off-by: Lukas Bulwahn > > --- > > kernel/trace/trace_eprobe.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c > > index 4a0e9d927443..460d3ec8a256 100644 > > --- a/kernel/trace/trace_eprobe.c > > +++ b/kernel/trace/trace_eprobe.c > > @@ -883,7 +883,7 @@ static int __trace_eprobe_create(int argc, const char *argv[]) > > trace_probe_log_set_index(1); > > sys_event = argv[1]; > > ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, 0); > > - if (!sys_event || !sys_name) { > > + if (!ret || !sys_event || !sys_name) { > > that's right, miss case sys_event and sys_name are not null, but invalid. > > it should be if (ret || ...) ? > Linyu, you are right. The visual symmetry tricked me into believing the line above was right, but it is clearly wrong if you think about it and look at the other invocation. I send out a corrected patch v2: https://lore.kernel.org/all/20220811071734.20700-1-lukas.bulwahn@gmail.com/ Please review, ack and pick the patch v2. Thanks. Lukas