Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2941528rwp; Fri, 14 Jul 2023 14:08:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRwQdedKmL6MMYxmUcX4uBfGDVlMcQ76H+GNerSsuOkSY4OYGWlfO14nPQCMFWr3bjhqq2 X-Received: by 2002:a17:903:24d:b0:1b7:e49f:39 with SMTP id j13-20020a170903024d00b001b7e49f0039mr4863695plh.60.1689368897989; Fri, 14 Jul 2023 14:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689368897; cv=none; d=google.com; s=arc-20160816; b=LUAvH96KGSFOvpr89+xSuLv1oZNOH9bNx5v6MNkNDiTqjobZe+d0SnKLWKlu2LWsoQ /rsuA1spvrdo+ximd1dMspT9N5+rdy7aj7sP2na3P6YZhfpuAn9blO8UDAruQIfwLTS0 obfkLUGi1isHHVdbQ+aDqMsDdl6EM+BcueHRfNwJcskq1D+IBl2VtShOb8bWNoVLhmdn R8thznnCPLyxG/tejRTv0tqBwnVVM6FhmOpG/CHvMhiFxdYVWQfyw9oCSGpgNCAaLFhZ c7UH0WQcaj0yX4kgyJE1YiyC6lFk7+kji1F4A8j4o83TEeuZBt0zWwY6ya/3fiOfgyJ7 IHHg== 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:date:subject:cc:to:from :dkim-signature; bh=mAeO44fspvwOoH7nvzffkhGKK/SjhUPUJKy34qDXlFM=; fh=vV4e6bTEBYgILT9RdignFZU3fCJnfjhi//8iRHksXxo=; b=RqReJIpBNHSE3HVtOuDRnUqqyGWXploClHWhR9P6Lpxtt9liQbKPTymnK/jzQT/a2R x2YCKgD5VppdulSaHuih1HUY66WD5OV9id5wE73lm/UuIdaVDanX1lMcVE5sMPh5ULCq YqRN5ebv+/kd/Gg0QKtzUcATABlhoeouVKr13oNbavIFlkeOZIMbjc2py5X96Hqr3KZN J+PR8vnXldDT7i3auRgBxLd6KVozpOTZzIZy3HvenWj0rxQ381+lgZWF+wVXOjrR9xo9 zSSm0jyLpWb0Ouja2LrtYcOeyDvNrmbqeAMUjO6jFMG0c3NM0LGAJttCFs3NkGhaCMx4 veSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@purestorage.com header.s=google2022 header.b=dCwKT0VS; 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=REJECT sp=REJECT dis=NONE) header.from=purestorage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a170903228e00b001b829a32f2dsi7919414plh.457.2023.07.14.14.08.06; Fri, 14 Jul 2023 14:08:17 -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=@purestorage.com header.s=google2022 header.b=dCwKT0VS; 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=REJECT sp=REJECT dis=NONE) header.from=purestorage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236097AbjGNUeD (ORCPT + 99 others); Fri, 14 Jul 2023 16:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233301AbjGNUd7 (ORCPT ); Fri, 14 Jul 2023 16:33:59 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D29335B0 for ; Fri, 14 Jul 2023 13:33:58 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-676f16e0bc4so1592841b3a.0 for ; Fri, 14 Jul 2023 13:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1689366838; x=1691958838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mAeO44fspvwOoH7nvzffkhGKK/SjhUPUJKy34qDXlFM=; b=dCwKT0VSj3simmiqlpl48yZ6sLmUEEhlefo8jBCedH1UDexzmM/7NMzp3My2D7jvsJ IlfEuWV9Gi4VeNPn8YTXhmZ66NCQtspqQM1Uyx/zzvWd8Q0lAcMqdh18ws+dk5oG/XBn HSTk0cNgum3FrP/ED5FvYjhBPux/oQJkDlOjw5H0GswLZByKXgPqnjR/ZMzZJ4IAOeOR 3k7XN/n3X5rxyRsjVbLwJoFJ+t+75tO2tXOycgMzlhEFbJf+9PTSglFxmMNhzQwiS3ps fdJaqowXB62u/V+KuC95ulJpvzk4DY/LUWNHbfy688d2NKIKqFJzLEwbbRCaxGR052kn Ia+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689366838; x=1691958838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mAeO44fspvwOoH7nvzffkhGKK/SjhUPUJKy34qDXlFM=; b=M8ldx8rfcf16nGeRW65OMIYKrezBEMUtVmqw/+4FGPHCtBfw5Nx2UcQM3pZUK4ezmQ EI0bh54nNg2jm+Ggbb8VvLxkOVTvt+HQFD+kRZMugYSeXhzSzlZ5cYbfEzr8pZPeAZxd QkCSbjxbBw1A8Katd3TsIsv8aB8flOR4jac2ay4v06FSg7tnzP8fLPlNcP6ZzqNwK/fm Cp6lWcPoREYWOyyBiwaoCnPoGmL3TEEul3TNoiVQyhUIQaa29Yp0GAzCGPz4QfMVDsoC nNIQHsK++2/8Uzq8P0gwDbww8UgeQpnLJFJFb2ySRZllzH1RFSyjYxbVeHj4UWyqqllL CcdA== X-Gm-Message-State: ABy/qLa5/o1I8GvAPgXlhr6IUnhv4GP5244yxbWwQQBVjA60P3lyakRl 8Bnln1Rd84NF2Z7UYTXNY93N0w== X-Received: by 2002:a05:6a00:190b:b0:66a:2ff1:dee4 with SMTP id y11-20020a056a00190b00b0066a2ff1dee4mr5554905pfi.2.1689366837881; Fri, 14 Jul 2023 13:33:57 -0700 (PDT) Received: from gaia.lab.kspace.sh (c-98-207-191-243.hsd1.ca.comcast.net. [98.207.191.243]) by smtp.googlemail.com with ESMTPSA id m13-20020aa78a0d000000b006828ee9fa69sm7525951pfa.206.2023.07.14.13.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 13:33:57 -0700 (PDT) From: Mohamed Khalfella To: mhiramat@kernel.org Cc: Mohamed Khalfella , stable@vger.kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org (open list:TRACING), linux-trace-kernel@vger.kernel.org (open list:TRACING) Subject: [PATCH v2] tracing/histograms: Return an error if we fail to add histogram to hist_vars list Date: Fri, 14 Jul 2023 20:33:41 +0000 Message-Id: <20230714203341.51396-1-mkhalfella@purestorage.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR,URIBL_BLOCKED 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 Commit 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables") added a check to fail histogram creation if save_hist_vars() failed to add histogram to hist_vars list. But the commit failed to set ret to failed return code before jumping to unregister histogram, fix it. Cc: stable@vger.kernel.org Fixes: 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables") Signed-off-by: Mohamed Khalfella --- kernel/trace/trace_events_hist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index c8c61381eba4..d06938ae0717 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -6668,7 +6668,8 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, goto out_unreg; if (has_hist_vars(hist_data) || hist_data->n_var_refs) { - if (save_hist_vars(hist_data)) + ret = save_hist_vars(hist_data); + if (ret) goto out_unreg; } -- 2.34.1