From patchwork Wed Dec 7 03:46:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Yejian X-Patchwork-Id: 30614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3195530wrr; Tue, 6 Dec 2022 19:51:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hOUBrweDmR72PeXyGexKat+PRJZuHsQzU9b+TE5vpnF7rljbrlvE3Z6/m4zO4wkcjEQOM X-Received: by 2002:aa7:da10:0:b0:46c:43ff:6961 with SMTP id r16-20020aa7da10000000b0046c43ff6961mr17424300eds.14.1670385093019; Tue, 06 Dec 2022 19:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670385093; cv=none; d=google.com; s=arc-20160816; b=UmMGtII74keoJkqaW1DISKYwIhQjfuDhGkmAGtaLrLltOjglzPKyNRA80d7cAl6Pk0 C5mLdL33+fGmtNT/+iW8K27pgX9wYKLYcSWRT8Mp0fkiGbBaiEGFYGEXAbHPHfeTjqzT HzgeK/gCcUvjhZ8q0ohajFMyM0yB+coj/Iaa0ODyhJhj4pFN6a6vCACe4UEAn5ygUrAc aUNoWJ1Yous1t+xYhRmR3KsH+Xu0X6a+jxcuqRlW5PAaSJGeV6LzwdUUav6T304Ws/9B ZNnLqdooPVFanLZa1+KxJ0gpRlf/NSkxa2Uk41tn3V4eDiad2jShhJJ+wHTmd5rzTtln P0Uw== 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 :message-id:date:subject:cc:to:from; bh=35mmHRmntRQteEwucSawnM0U3/KfiYfEMC7RuOckpJE=; b=Vv9GuveILvSfXMfgla1QEf8fco9mUQmayvmZcG5/Qm673TVug35Wimhy5eUkqiYbB9 wja3XeLUNmZOWjbsrRQTC9l5tNspGFzI3g4b4CpfMZdLZujka/zKUuOl7VhmI+P5R5GP RNv0nOLnOOGImkjDzqfH2hkOuLw4175JrgOFcdv3DisENtMZ0Pcg5D/JNdPCLiKIkLow whOhPLvvbGSScgikPLk+ARMwk7CFjOcymOvcjwMQiY4265bulAoPFTbAXz940Zen8cRU WIhvGvEv/e7wn5aJkUtam+tNVYZQuDc8tC8QWzrPDKz2wWsdNW13CbrxmF1byGLjmJrb ntow== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js10-20020a17090797ca00b007bc93454b3fsi15560199ejc.953.2022.12.06.19.50.59; Tue, 06 Dec 2022 19:51:33 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbiLGDpw (ORCPT + 99 others); Tue, 6 Dec 2022 22:45:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiLGDpu (ORCPT ); Tue, 6 Dec 2022 22:45:50 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0738FB57; Tue, 6 Dec 2022 19:45:50 -0800 (PST) Received: from dggpeml100012.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NRjkp4pPpzXdYY; Wed, 7 Dec 2022 11:41:38 +0800 (CST) Received: from localhost.localdomain (10.67.175.61) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 7 Dec 2022 11:45:48 +0800 From: Zheng Yejian To: , , CC: , , Subject: [PATCH] tracing/hist: Fix wrong return value in parse_action_params() Date: Wed, 7 Dec 2022 11:46:35 +0800 Message-ID: <20221207034635.2253990-1-zhengyejian1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.61] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751525719297734568?= X-GMAIL-MSGID: =?utf-8?q?1751525719297734568?= When number of synth fields is more than SYNTH_FIELDS_MAX, parse_action_params() should return -EINVAL. Fixes: c282a386a397 ("tracing: Add 'onmatch' hist trigger action support") Signed-off-by: Zheng Yejian --- kernel/trace/trace_events_hist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 1c82478e8dff..370474659827 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -3586,6 +3586,7 @@ static int parse_action_params(struct trace_array *tr, char *params, while (params) { if (data->n_params >= SYNTH_FIELDS_MAX) { hist_err(tr, HIST_ERR_TOO_MANY_PARAMS, 0); + ret = -EINVAL; goto out; }