From patchwork Mon Jul 4 10:55:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12905117 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79900CCA479 for ; Mon, 4 Jul 2022 11:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bzHLp9hJV+SjpUFIaLf2px9aWgtjoRmxvecFkYkBpQY=; b=PNY8KOt5G3QXmY vF1kvWbNOXljpp0sNAHGJ7jppcQ9tSKB/xY+vhlciMFg0dLEHXKQ16aZFXgqr8meQFapryM7nOHtQ vjTX3AsuJKmmMuywkLPfB8Xz+eivXgTxUsbSWiKyD3XpktCvO/0KAoshHeBNKVyY67yjcTMvZb6A0 1Ph0UpaK1yKCIcPubp5La7BwkaFn6jUXeY9KNl96DnsUZc0lOKq00+92OepgvolQVfGctHrvscKMO wLyjmooT1VullRIWsTqshQV/alJYSRPnO5pnEBiPLpuT0Np119kuOd8LhGYxEOKKCui+pQs2BLQB/ zrcSnuodxpvk22Hta/hA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8KFY-007jce-5m; Mon, 04 Jul 2022 11:28:21 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8Jjv-007JJZ-V9 for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 10:55:41 +0000 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2648Q3CS006304; Mon, 4 Jul 2022 10:55:31 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-2021-07-09; bh=rKWKFgZCTlsm7UOXDBp+ZRWo2mW1/S9hQREhLCz9Vzo=; b=b9HQ5n7Qar6P0s0JwopLYfPi37Hzw56O6TbNz5xba86HbQ7bSqzPn6YTpQ7Q/rk2Lvah HzW7mehpEBrTEOIPsgEnXau+zyyR+XHbakiZvtMfyIZUUQOmpscp2D/28RTe8eNc2J1D TV7Pqlvq2G0fswGLGDzo3qrQcWp/ybtX9C5Pc7/E8RWhaf0lO95QmZAaDn4dNeT8B3Ab e1CzzraVALo7qJvYNSZSc0zdkgj7vt/KYPkHA7T86PrwVQBHThpj6+fcqdaFISveulG1 kgWOiOJCv8Pom4z9MCnVQXaXFq2a0wrwu1WnQzbqVUCkkGLX5Df7jYWBHbwTYFaTkH+v xw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3h2cm0k8t6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 10:55:30 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 264AtLul004161; Mon, 4 Jul 2022 10:55:29 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3h2cf7npmk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 10:55:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hD9IhmUYUcdmMT8e/Himt/kYeA+Yed5xRDt1+DbmOaQvtBiXNriHCvpE7csBzznrGiQvx6ps3d1uwvuF6BO9QSSxR2W13q4C7jla/h7vc55ueDfAGdBjPfAPSERO/GZ0Ru6Fe58lNrfWhja5ktLoVnPEiZGi6YkCJnjERdNt5RZk7nGOjikzb8MGAQC8UV9re2ICPol87iD9i6fbAzVTja8hNMmdHztbmwLd6wbzZ06Se2U6vGtZl17lM9RzIJ+K/apEhQiszYutaiWgveLVHcByogBDI4LfHuNPvvc1tudPcaBz+2vKcxRRI09mKfq6uiTDF96ZT7KO8jn5D6NWYQ== 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=rKWKFgZCTlsm7UOXDBp+ZRWo2mW1/S9hQREhLCz9Vzo=; b=A+2M7Pl3bo4nbAgloVJikPhEgPNsDHwgEige+LgsuFPCeu+hTeA41tmZEtLoxfSZK2qoH4XYWreBoOUKrrKF3KuBEETG8aeoy03q/DLTUlnxgNDTX7nQdg2oYrRVK0Z5N0NWxp6uxdf0AozjV10NCzC378DQya8uYBwY72guHh/J7CH7csHKWC7hgLz9If4xYrw8p9dYfUIyESqAsuNMo/Q8kdeRfy9DASvgFNvChcz/2jTJvfOK2tCbaAJCJ047jdgJrASQOSeHfxNEpGJlMAHcEBIJ89VMg++LdvoCwnC2WniGhcaUDnWAPlyzZR45JXDVaBX8mVRfA5+N7ztq5A== 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=rKWKFgZCTlsm7UOXDBp+ZRWo2mW1/S9hQREhLCz9Vzo=; b=LGGCPI0K5w3exo83qxCg0bpziWhX6pr/gRzP6qbNvDSW60WxIHLrFqTYTGEftMr/ysqP0aJR7Zv+SoX7k98yAWT/R7wxTcM/ihu6fk8sP1F9EeWIiD3rYmSqjVTFfuvKr06WXUGYJmIorN6LutBQOQD3kE/s3jXPceMK9jLWSZg= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by DM6PR10MB3563.namprd10.prod.outlook.com (2603:10b6:5:154::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Mon, 4 Jul 2022 10:55:27 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5395.021; Mon, 4 Jul 2022 10:55:21 +0000 Date: Mon, 4 Jul 2022 13:55:04 +0300 From: Dan Carpenter To: Li Yang , Michael Walle Cc: Shawn Guo , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: fsl: guts: fix IS_ERR() vs NULL bug Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0018.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::28) 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: ff6e8ae5-8649-425a-869d-08da5dabafed X-MS-TrafficTypeDiagnostic: DM6PR10MB3563:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YV5LEkJafSiWkSiQY/5VjkktZOssm1R3wTlzZOfh9iVi8VMgyV2XCNjDVkkCNuq1TQZ2ir1XSFU+cDcGlHcCUaIXKi+xVf3SdNcK1DE80DX56MCxF/2soinlOdJRPjzDAnt/wB7r+blKqTceDeYiZ8rJvfp1m+BlZ7nZPDozkW0IJBBnvq7ZlARPvB6KEueziCewrdX0FIxIo7WPSXXv7vcQ3JSrIPavR64RUkT7lG4HVTdzMF1shMeTrAKdBM7f1QahVKKoKso0S7ANEDCVA0vhe1yEoBXrmffGAFDAbERiWVAP/fd3+W2Eic1+HbRL9cOf8M+YT3KEnAC3b0GXVSgbVioobFhCywW0DTOGcRrD5nRIXPLt1xQZHkXlWnPJKhKvgja8wYJJrMZRv2p9Z91TovsxlntyS9wZYahFe9F2Em4WD4uTjs4ExH25f4FHzZRsldgkYPgDz4EyvFrMDfNonVWJVwZJhn0Fcyy5XL5kQGBH81DJqAZcjPd7WS4ep3NFlBf0GL9tiyTXH/zl9HZyNP3cbYwA/unUVOKMJLM2/mj7Caqo7bfj5si60QWaM2xj+8RZgVGnsHiRIjBaewoWvUCjCY66lejs50J7nC4mcpB1qNKwcmhSnxXsCRXYcVpu/nhZtIWlXK53zULp7KyWTihrQl+CuZ/Nxdf61JVhQV7m/n1LQVqPEhmtz668EA5HaFyv2pxlmtIeOcDi+cdCM0fIPVr3yASj9AsMsuvE+t0f54frhC2oHO+3oBjIqluNWxC1BSBIkhKAE7DCEmRVoQe9fG5mjW/e+e0Zapu95AmrRkozVzBQEIby5CRN 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)(346002)(366004)(376002)(136003)(396003)(39860400002)(110136005)(66556008)(478600001)(6486002)(38350700002)(86362001)(66946007)(6666004)(41300700001)(66476007)(26005)(9686003)(52116002)(186003)(54906003)(6506007)(38100700002)(4326008)(316002)(8676002)(33716001)(6512007)(2906002)(4744005)(44832011)(5660300002)(8936002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEA9xdUzqenbkSNCa7jNFfIdTBY+MotUGFgsciZGBYRtEHwkf6UvfR0BoINAkfXZB1lxm5qfrdHeOaqmZwNOqWrk4zNcDb702J+ANAr+BPI8DMIznVzzn3xuiVRs2HydsNy54N2T3KbnI3+MCShQ/UhDdtjKJN5PbSBqrCM2/u/xLJg2IVnllAZDWtI+OtNz0lyN7vkSSq/gAVaHObyeSOEGYZPcD0Iq3vtGoSppzvJN+YfzsxQjxPlT7Lr3dLkMI8kfua266atGvhLfWoGfwevms8KQrCrFGK6RbyxcxW6vbp1MpRDZ7spgWKT3FLlbq1QJnFThO0vMZfYxfOhSC98EewPOWhKrddxJR87fRdvtqnziSMi2Ib9Knhtx6ciEvGtUVtnufwopqC+LpjIDQWzuqPhlfc+AZvkw6dNMHzhuMHMxUg4z9F6MrOcJ6jmgpNcG3wYo2ogRKhQ8yOIuds6vTQC2wf5vi/Ewx1MUieS7jALFf6pE0NM+POLGWZyldJJVhdXLe3fLC3YfS7+Qtgl5JlNuc566E7YlUQh8HlfurGbtUnuMDmMl1lOPzAwES+1irbNNJGoK6T2Nl+gj/bcyl9QWUBfp6/D/ukzfhOYVjByM+NCWwQCTjImAVyupA6l9mS/Vgibvw7VRqfpZT/ZNqJYTpDieXmXs5c4ijICpDHreXGK/6yhj55EhL+v5dKAgwLrfXRXOROIuG6bRI8ywgdv8VEypLpGItMASuvI26cMqU2Zhvb81eCikvcmM7+GcHn7fHqJgw1ewezfrNI86D/sHhGMAWWcXXdZSwx3AsPQnklyw4oaJ5Ys0dDsquY2E/yCzBZsnUOqp5Dy3cKeyl16OCabzOTyDr0JtnZlXivi7vIykytspEn4oeyzCk+2ISNEb4tsPTF8arIdzM2gHQ7z6Rl4P1+zf8GlYAMUcxEs//frf7/yTqLuMqLd6TeDnIFm19c2WZKvfZqee+GAutA3wESSAQE/GtBdRPIvWqZriJtp+hjo/KfAfcnIXpKrUs7Ye39aMQkrNIipNvxrjD6LcNA7jLYYqkxvkMX6sM5P6VqIdPh3UQFYuO+/xBWEBDyt/adhDdO2bQRIoBhJGQJ45mUZj8hyikzDncFB79wBkKU53loWoXBnfwRuctwyeXadpnhRAqrrytdrW5i6y+3XODwGOw7fF0zlsw5X3MKkCm6prTPtXP/hIvQZkuW1JX0I5DW5AAhDa3P4sVNUu/RPicdFz1HVEpX8Ew1Rdx43ZSO+nPQ6pI8UQtad1ouyI+w5mWtX+ByO2GxfqDoWAQIidbT2sVqpfCkJXMbgWwf1t9BhqfA3cG2cDz6LpBzCOtL5/bbljtNRoHdzZM/ZOafTTYIy+o3DCjfa3yMHE6HRNJh90fx7SCqYHJveX2MGPl8CAMdClx4zCHMWnb7wUYApCVQt50FPTwrdYq9k1WQ7Mjgi2rIkOYZfeJXgsGZJgkwzwJrPJu89umAMgvyJYtSh20MdWxEI0teLXwman9vv/2GzErbIV2yxWDLgCoWl44OAsMiH7+5HA+c76638c4bbkGFc/Xj3Kjwerx/pkLJcSO+pHeidFVaLDX5bi X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff6e8ae5-8649-425a-869d-08da5dabafed X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2022 10:55:21.0278 (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: FQ3zKZSaY9xpDdOkhpM+xlppeWgUWWus2lFIhY1K5IleymyJQv7Q99wtGJjWt0vyHr8xHbu/NoXRKRE/gIBVM9t23QDFElPttjCYtb1kQ4A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB3563 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.883 definitions=2022-07-04_09:2022-06-28,2022-07-04 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207040047 X-Proofpoint-GUID: 1B6VlqVfRgqzMmP96YQArdv7ZlJ9j5cN X-Proofpoint-ORIG-GUID: 1B6VlqVfRgqzMmP96YQArdv7ZlJ9j5cN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220704_035540_237987_602479B9 X-CRM114-Status: GOOD ( 16.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The of_iomap() function returns NULL on failure, it never returns error pointers. Fixes: ab4988d6a393 ("soc: fsl: guts: embed fsl_guts_get_svr() in probe()") Signed-off-by: Dan Carpenter --- drivers/soc/fsl/guts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 27035de062f8..8038c599ad83 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -195,9 +195,9 @@ static int __init fsl_guts_init(void) soc_data = match->data; regs = of_iomap(np, 0); - if (IS_ERR(regs)) { + if (!regs) { of_node_put(np); - return PTR_ERR(regs); + return -ENOMEM; } little_endian = of_property_read_bool(np, "little-endian");