Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp255310rdh; Thu, 26 Oct 2023 00:54:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg2yKIulQ8eTAP9x1jwhMes8OKVAfi1iSegSJAJw5TNms/JAYFMRd5csxVAJRz1hA26ykw X-Received: by 2002:a25:d107:0:b0:d9b:6262:43be with SMTP id i7-20020a25d107000000b00d9b626243bemr17859047ybg.16.1698306854290; Thu, 26 Oct 2023 00:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698306854; cv=none; d=google.com; s=arc-20160816; b=Tog0rS8sI8deodjeqvXbhJ1ipjz3dJHeMcSaT01K7S5B0EiNF0gbv2ump9Kwk8bLiY yoaxdOtl3TotGBq28S0WC3OLsaDHal3bu78wF5AbEtrFdLG65c8vxn75ceQJOKZWa9BT ugFRv3P4A8G9rX4fwlQBknIS0H5jah0j3/R3zrJjMljX4TwW4mHVWFIDwYipPgskhADq 8yEKSu8/MZTtLcAisBTNp2FxP6Aps2pYjBFYWDie5/W1cTElT5CDxKgB3QxEaE67DON4 /emTkJRD/yVdTgHhs+PtlMuo6oIhzDZEn0B4SXGTjscvxuzWJtX9g5Cz/BwmjGtyZSNW BEBg== 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:dkim-signature; bh=g28l6GSOBmSfSFI3TH423xZ/It8yYFXLRt+Nab+zghw=; fh=VAOaywrDtoiEurkDhj/KpBpnX+2aOZn6NB4n9kIkO3c=; b=gLyDi5LFPyd/ih9G7AseL4BbczZVIUs4iU2ffPcf8922wQV1CpjoEwSnN2jfCU3lLk CQC/F+lroR3X3fTtXI2JagrTgpkLYfpbLEetlqMemx8V5VkcFniu/FussGWCZ7zMrwRD Djrf9hDL5ZlICZG2cXsW4ycweVL3qsc0UiPNUqLH4mw5IjV5mJqU1hv7Yv0Matk6KIpZ roMQLNXTW+niE1Hi/+tqDxKuvmpif6ZOZN6lJYDjLVn7hLAL1qy0wnVAQUwXrG3FOR+g VYw1JA20NHbZ85s2yQ3uMSBxbKCfdFGDus3hKNrEHQxGtlFsBhh/vRTzYh/ETJtxUD5V OhLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="d03e/dsO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e194-20020a2537cb000000b00da038eb6f7csi6874321yba.675.2023.10.26.00.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 00:54:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="d03e/dsO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7568581BB186; Thu, 26 Oct 2023 00:54:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344448AbjJZHxx (ORCPT + 99 others); Thu, 26 Oct 2023 03:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344506AbjJZHxu (ORCPT ); Thu, 26 Oct 2023 03:53:50 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59854186; Thu, 26 Oct 2023 00:53:47 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39Q36JS3006400; Thu, 26 Oct 2023 07:53:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-03-30; bh=g28l6GSOBmSfSFI3TH423xZ/It8yYFXLRt+Nab+zghw=; b=d03e/dsOUr5p8dyargQ+j7CnMsByuK4ZKE02Sw/xz4xIHp8yyNc1L83xCV9UG7d+qs1d AsNSCyc1CfTnXlFtRbC9GbOZ32GHg46gU9uZGnA9suE2MI20bz4V0HOjiNq+A2g01m2a 8nHB1XqsrK0+5KtAGL2GToV75SHyiGjBCi/GGk/05jsLayGjU7yUKUTy96PRcTQxdqpC l4yVjyZv7gN1/HZuNftM3nZlIIT2QD43mZX6Iu01isHd7Yktgcb2Z5xXfPryA7TTF4BJ waAajb165A79B631HBN1TYV3xKJEbQRGPaYTeSCN00kahmRGb4+4AyAieJimW5dHmSHL gQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tv581tcx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2023 07:53:34 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39Q7I1Zq031168; Thu, 26 Oct 2023 07:53:33 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tv53eb0fp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2023 07:53:33 +0000 Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39Q7rWde032431; Thu, 26 Oct 2023 07:53:32 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3tv53eb0f5-1; Thu, 26 Oct 2023 07:53:32 +0000 From: Harshit Mogalapalli To: Dipen Patel , Thierry Reding , Jonathan Hunter , timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com, harshit.m.mogalapalli@oracle.com Subject: [PATCH] hte: tegra: Fix missing error code in tegra_hte_test_probe() Date: Thu, 26 Oct 2023 00:53:28 -0700 Message-ID: <20231026075328.996704-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-26_05,2023-10-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 mlxscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310260065 X-Proofpoint-GUID: m44YvrSfAsxhxhvjoX4Wz3HA9NWhe5uk X-Proofpoint-ORIG-GUID: m44YvrSfAsxhxhvjoX4Wz3HA9NWhe5uk X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 00:54:11 -0700 (PDT) The value of 'ret' is zero when of_hte_req_count() fails to get number of entitties to timestamp. And returning success(zero) on this failure path is incorrect. Fixes: 9a75a7cd03c9 ("hte: Add Tegra HTE test driver") Signed-off-by: Harshit Mogalapalli --- This is found using static analysis with smatch, only compile tested. --- drivers/hte/hte-tegra194-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c index ba37a5efbf82..ab2edff018eb 100644 --- a/drivers/hte/hte-tegra194-test.c +++ b/drivers/hte/hte-tegra194-test.c @@ -153,8 +153,10 @@ static int tegra_hte_test_probe(struct platform_device *pdev) } cnt = of_hte_req_count(hte.pdev); - if (cnt < 0) + if (cnt < 0) { + ret = cnt; goto free_irq; + } dev_info(&pdev->dev, "Total requested lines:%d\n", cnt); -- 2.39.3