Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp176214rwb; Wed, 10 Aug 2022 17:16:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BQCgCB9sFzk3o4Atw82SVe10475Y1m4wUKdkezWkPPxDOW33RGY+R0x0Dh9UNfCfDTeNY X-Received: by 2002:a17:903:2646:b0:16f:1d75:3101 with SMTP id je6-20020a170903264600b0016f1d753101mr29644293plb.111.1660176989619; Wed, 10 Aug 2022 17:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660176989; cv=none; d=google.com; s=arc-20160816; b=nVFTDbeRQbmSvxJMiKc78YxTX1CDiDYPgwfl9MvVI36QcdQohHoQZ8gM61AxNH7dtY js2+bhrQKznF6vXIPOlShS8aagcAgXhc0GEwSitUXHmrW5The6jzPLXXNKpxGaABuxR4 o/Ku5vxR9ijy13du18ctIbHD2tU6FLFAQCrXVKcpQkWBER6TfH0XfJdque0gd8QiFGmG jLf5ISAPse+zFjMz41cSazF+9RXR7t6/Cw+GnGtDENsyZ4YZRTxoqgcAWLWMp2/fjBCc 8s9KDo316dug7HhhKFRL1zPet30TXzcc2s4hVEqsVNltsTbtGmyBUG4s9nFk0XppqcCI amjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=quIGPsqtLqF7aXUBe4lP+sBqoJmFgr07FA5mHK6JcAM=; b=MQMBFZXBsoBtsYuaTCK6bMDy43xMGsrhDb7tl+Uwj4aRCezrJJBI/H5b7ajuhbDmwO NxiNMm3EIrfpyKq6ObtPwhIl8e63E1g6FlnYHTua7CUZw0gqOzRoC75se1oHXy5aBGFL 874PbuP8O+r8bQLQAd8KsIike+QDZTTuSfG4H8amG3jr1jNPC4jdzuPsMTx3/xtspEx/ tKPdu7rTLTrxlZFYNCkYMoba6E7L99cYlaus+37B0ehby8fDHiN4rWe+V8+iTt/ccwrS y8gE9DkoSWsqbuKogUjrk3Pc8Xiu6I9Df8qd0WkDK7NlOKKSnQAeNDU5rwxbyYzFZBYR p/qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kCVBBFT4; 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=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902dacf00b0016ee0d9848bsi21021146plx.47.2022.08.10.17.16.03; Wed, 10 Aug 2022 17:16:29 -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=@quicinc.com header.s=qcppdkim1 header.b=kCVBBFT4; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233664AbiHJX3c (ORCPT + 99 others); Wed, 10 Aug 2022 19:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiHJX3a (ORCPT ); Wed, 10 Aug 2022 19:29:30 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22107D7B5; Wed, 10 Aug 2022 16:29:29 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27ANBbf0023102; Wed, 10 Aug 2022 23:29:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=quIGPsqtLqF7aXUBe4lP+sBqoJmFgr07FA5mHK6JcAM=; b=kCVBBFT4TRonS7fhm0QRXdI0UjO9qurXCgUjvYh5y6rqi6tnfqjsdjKQYS+IO7JhGiFh yH3Sz7YlocIdeBPtvdCA6HKmfpCWKORDjw3/848AT2ubCMBMsMxT4FJLXwONL5YvAd9C dakJ8KOCBEoS1cn5ckxDyI5Zf458VSkL3F4IVckLGQZfeYH11/OxvZIR5yVbikLsSwsq feg1Fadr2EdXuXKZgqlfMzBLeAGcyzjA4ih1TT/twIc+cxW9uozkTWs6h9eT2S1cM2aq /HetVCmpqx2VSB+XbtIieQCUUcw+Lpd5+PSTGdrGZttKylb9Nd2zY3Cu6yezAeySRi+D Ww== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3hv95ytg18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 23:29:20 +0000 Received: from pps.filterd (NALASPPMTA03.qualcomm.com [127.0.0.1]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 27ANTIPb020777; Wed, 10 Aug 2022 23:29:18 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA03.qualcomm.com (PPS) with ESMTPS id 3hshck6uv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 23:29:18 +0000 Received: from NALASPPMTA03.qualcomm.com (NALASPPMTA03.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27ANTI5p020772; Wed, 10 Aug 2022 23:29:18 GMT Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.47.97.222]) by NALASPPMTA03.qualcomm.com (PPS) with ESMTPS id 27ANTIIo020771 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 23:29:18 +0000 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 10 Aug 2022 16:29:18 -0700 Received: from [10.253.34.2] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 10 Aug 2022 16:29:17 -0700 Message-ID: Date: Thu, 11 Aug 2022 07:28:03 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] tracing: react to error return from traceprobe_parse_event_name() Content-Language: en-US To: Lukas Bulwahn , Steven Rostedt , Ingo Molnar , Masami Hiramatsu , Tom Zanussi CC: , References: <20220810150921.8858-1-lukas.bulwahn@gmail.com> From: Linyu Yuan In-Reply-To: <20220810150921.8858-1-lukas.bulwahn@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: o7JyeiHgJQYR3zvgatp7QlQDUrb98LN6 X-Proofpoint-GUID: o7JyeiHgJQYR3zvgatp7QlQDUrb98LN6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_15,2022-08-10_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 clxscore=1011 adultscore=0 bulkscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100071 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, 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 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 || ...)  ? > trace_probe_log_err(0, NO_EVENT_INFO); > goto parse_error; > }