From patchwork Mon Aug 8 11:29:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 596359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0445C25B07 for ; Mon, 8 Aug 2022 11:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242767AbiHHLaC (ORCPT ); Mon, 8 Aug 2022 07:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbiHHLaB (ORCPT ); Mon, 8 Aug 2022 07:30:01 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6F9E0C7; Mon, 8 Aug 2022 04:29:59 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 278ASmIY015210; Mon, 8 Aug 2022 11:29:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=xjpIa5jb0cT7c+dDCFPoLT1GZJneSMzOd954EGh1L8U=; b=Q+/7A537W0FwXXlid3G7C7Jq8v5N5rBLLW/dwF7NPtDOOYO1PsD9Idh+g+T6adThg1xl wOPnwmmesH6exxBw4wzpde+tkLu4oZ27Vfg5ZqEuqvcOkmAw1bBIurcFJ0+jnMAEikQp ILHccyILvZpoD88e7Tw1+CCj2mVtUTlEuvd1rWe1vjiIQU1S+7GtKE8EyHds1ES/tgde RTDb91zU55AYxZuA4QNrBm8qM+8SUJ7nyFWgQ8wBbF6No+6s3oAyTAdMUeq1WXWa4+Db 4EQR7zT5yUHaoEkqwqbD4R25xRXtfyNLmRhIeMswSxK/1Hv5tuJmwrtEZLGI0YHEogM0 Dg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hseqck7hd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Aug 2022 11:29:52 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 278AI8hK007743; Mon, 8 Aug 2022 11:29:51 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hser1tn34-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Aug 2022 11:29:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SuZt+t2T5XvTKruHLkZ0N1a3sMedOoKFtEhNuVPynr8ytck30YwODeJw+IEcs6HKLB7HM0loNoxrSxUF0LcKjRtm9+H9vr94CBqKzBoKrOVrp/ftnPFwLF+JeLXz+H9JZBllvkZcU1Pz+NXxkpbuuhI+YWesunTH8PLTQ09NlrUlWygTAVggzPper7jOHQ6aFyCjvrM2RrcDf7QXAij5cpXskxf7PXPVbYSG8uxx2NoNhxpdclAEWX3COAFNcjHBjTpWGCzirwkXmcUyXncUiuHZDkutWXcmsT668Z3FEBI3ZpS72qa5+gsI/ZQTo8dSrNGDgS0tLVJYH8EVvWqFLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xjpIa5jb0cT7c+dDCFPoLT1GZJneSMzOd954EGh1L8U=; b=a45v5I82PN9zrLgAfcroqJYg04pfD39Vm5cXmYuiCkpYV7++TqwD2u4tLRUv/6ELSWrI9xJ56t3sbsV9m64xoVCzzR8xyYPYQaQZvRxWjYodKrEK11vQtttrKt2jQxhWC8uVFYyTG+AOu58x3v9B/JW1Aq3iLIZCseFfREHt7iF8nuGocurzGTiSTMM0fb9rqe1h0wM58cns0M00G0mi6Lzd5pHNB9jODizKfojPKv6jm9h2XovZwhBM/4MLMmMeo0fOSwiS5vQCsbm+YndNnFForPSvJCXjWvXiZUjOc/Lb9LwrxN2JjOS6ERNW94LoLtyzFGM7M0JGGbpOz+fXwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xjpIa5jb0cT7c+dDCFPoLT1GZJneSMzOd954EGh1L8U=; b=j4VfqqvVQJHTkSevsPZeegS45wofoKEm7rWzQVJk5dpX5VAUOht1lCc+2n+r2y1bxRbZ8GDw5lvkPuH5EHO2k1WtrljvsMNPP4RKtn1GVxGFCfsLkYU9zO+yQsaKBcAqndDk/X+PWnPB5RxC8TijLVkE5bOOfCDAdanu2EvYjsA= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by CY5PR10MB6120.namprd10.prod.outlook.com (2603:10b6:930:34::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.20; Mon, 8 Aug 2022 11:29:49 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::209e:de4d:68ea:c026]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::209e:de4d:68ea:c026%3]) with mapi id 15.20.5504.020; Mon, 8 Aug 2022 11:29:49 +0000 Date: Mon, 8 Aug 2022 14:29:38 +0300 From: Dan Carpenter To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] thermal/of: fix error code in of_thermal_zone_find() Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0107.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::22) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ecd393e-2f8c-4596-5d02-08da79314dfd X-MS-TrafficTypeDiagnostic: CY5PR10MB6120:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: riWD8lVVbWuzZPdk19JCumvVWDjdzZe/gACKjxhDATdXvExxvAuNXiqDNmkMzka9MIbZURi/Y8efIDDlP33GmuzYYn6T+VtrPB4Rl+/z4cNkVF+mrKvAPosI1vZU7oKM0s8qqHGnyBwYem/P4MAIa6xm+powBzURAXu0kv3FI/vorKzOHPYkuR+5kGcYgGzpUew4XaPBzHF780vbmCBwT9tdYPh0ZwWRa6+S7C1XG9j6+K5/9LmKoumtgmt7OrX76jaDm4xdYLvBN8o3MUBXrDs/OJKteSb07QQvFoZ46nccw6jK3WmuggJvNki76dHusfudqNBbd+ZrGO6DfFROzD2xyUUHv9Y9vypRVdphsmUYGj4h5Y6fu+q/sGi33Gtl0/ZUunlLhjH1b1M6rDWw45mn+sdMDwJIuhfUdZgdpbuX4Dh4FjLBA323+g/yG8hFarr1J1V/53jgDO3PHw0p/gtvxDwqZhUy32stwLp1QUgOb5ntRsRXfX8mZSRw9SgmrXo+AMNFPed7kRIpptSbB7w+5jEi4WgZ1yFyQFHwYPgQYn1iujcRReh4Y+IEn6jP+dNJsOg9AG98YPUAjXezNR95iu2vRa5Q4Gl3xpythgHWHah44jy7Ec19j6k83gASTCiGfvnRXHHunDH/+3i+lQy10D7rH2EH99OTAiqltdg1xndimg00vqG8VhQVNDYccJ/6w0Qgcg0EyvJhniaTvknjqGG2z8NMUCCL7plXu7S5Mq8Oj94253qkZ94jlEz+5Lkr1dKCWTT+M/mza8zKn36mAW6zBFwZZ7EHkMMzOX89S+5hhhKHps/Xtucc6TBN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2365.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(7916004)(396003)(39860400002)(136003)(376002)(346002)(366004)(66946007)(66476007)(66556008)(5660300002)(8676002)(4326008)(316002)(54906003)(33716001)(110136005)(86362001)(4744005)(44832011)(8936002)(2906002)(38100700002)(38350700002)(6512007)(41300700001)(9686003)(6506007)(52116002)(6666004)(478600001)(6486002)(186003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UE31T8jytcZuNuqnUXXJdGytYtJkXstfNA222sjDuGM87yyyCIP5KZGZ30uuHuqgQ6t3342QLwOo1xZH9fS8SBmsEMfavdMGJv1Rv4ZZr0cpzi2TG3AZMNa47yy6ttEUrEXaWyP75ozfISR5hZgigMSoOOurMZSvvz+NcLpqf6WwucYDbpTf7bkqsRZt/fqjsXHsM5T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KXH5nztYWbU0BmxXvscxYYVPaTNFoDg9iCMc6oHKdGNk9k8FqIK1prQV239DMhczbw8dr68jg4dF/SvPnYlAY8x+WLh5TNhT8ToE0tf53M8Edu+Rf1chClYezyeRDQeb5XNNc7ZYro700Us3T8aeQLySB+s0ZCRlLYqqDe4S9rwfwR4WF057wkgc2hx5PME6mEWY9Zl8752Z1wKKpFQtpUv9b1neCsFpg+pJpj7sMPnjE8L+4mw+kU27raAJ4cBFEHI4G58q5YDXyQVLcc1Zget77CLljOzY3FbIK9clCDpxD5i2N4VibMQaDd5mtpxWif4Kk5ElGBjpp3MeCC/Vkf+uJIoeA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ecd393e-2f8c-4596-5d02-08da79314dfd X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 11:29:49.6561 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kKlEvcX1M7g+UOle+po2jKNWazzJVUUARb/zltuyHH8ExAnvupeHbevyN1beQyepdEbVVperkVUb7ssoeF1ntjrYOB7flkMzokMFm271xIU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6120 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-08_08,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208080057 X-Proofpoint-ORIG-GUID: c1iVzOhSZlrrluob3UahIoHVqc8vHPID X-Proofpoint-GUID: c1iVzOhSZlrrluob3UahIoHVqc8vHPID Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Currently, if we cannot find the correct thermal zone then this error path returns NULL and it would lead to an Oops in the caller. Return ERR_PTR(-EINVAL) instead. Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Dan Carpenter --- I don't know if this error path is really possible. It's from static analysis. drivers/thermal/thermal_of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index c2bb5954b21e..368eb58e97cf 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -368,6 +368,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int } } } + tz = ERR_PTR(-EINVAL); out: of_node_put(np); return tz;