From patchwork Mon Dec 13 09:43:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5pOO?= X-Patchwork-Id: 1567215 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=vivo0.onmicrosoft.com header.i=@vivo0.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-vivo0-onmicrosoft-com header.b=e5NtZ3oU; dkim-atps=neutral Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee2:21ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JCGtM4dMWz9sRN for ; Mon, 13 Dec 2021 20:48:59 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee2:21ea]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4JCGtM22vCz4xp4 for ; Mon, 13 Dec 2021 20:48:59 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4JCGtM20LSz4xpx; Mon, 13 Dec 2021 20:48:59 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=sparclinux-owner@vger.kernel.org; receiver=) Authentication-Results: gandalf.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=vivo0.onmicrosoft.com header.i=@vivo0.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-vivo0-onmicrosoft-com header.b=e5NtZ3oU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4JCGtM1pqfz4xp4 for ; Mon, 13 Dec 2021 20:48:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235845AbhLMJsw (ORCPT ); Mon, 13 Dec 2021 04:48:52 -0500 Received: from mail-eopbgr1300115.outbound.protection.outlook.com ([40.107.130.115]:11520 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234859AbhLMJny (ORCPT ); Mon, 13 Dec 2021 04:43:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WNUeTjfeAMGewPZteoTkP7aTOnxFsg/4IlhSI0wYy+h8RgmtkI1ZFTcwuac8PhsGqOAohcFBFciaNBN/uBkosEFToMA9XvLd4OjIgee7NUc8XQffVopJDaGR2gG2qAbx+Hv0KRp6Qyt4svx1rM82UyH0FHyZBXi9FknfhjXIm6u/I0k9lnacfcEHj1XSN+E0WPLQKtCL/sfcHoO3Y1buyym9t6bJ0OIfzvsg1+l3GS6dFriJZgePZLeoMweUCGbjoZugY79Sq8EhVXQIMkz44CGV/vSvttAxyUn2+RqKKlff2O6fbtGCn4v+BKY4kXSwV9/3KKqsPgRZouL8cZSCsA== 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=7MC8FyeD3iQoWhoUru8gZdJjdRC1HLcu2KHv7VaqJ8w=; b=djKn2HjjGSozIrYSwxnX7moO8OQDawXIL9+x1+2FXNeUOFfGW/BtfAb8vUuTNEZimEu/v0sZqd3y7SEfD/7I3dFvcEZvBfgNl0dCsy8blDiycbOpCMzRf8OserreVThJgSlSyWkilDidQeUbG/qLhtrL1g4MQw229XOyHPvoYaOW0XjF/f29PomkbkQB9wfqWiQNNrF3c71tS9z6QkWREI4lVCsbN3PdBP3xHOaaUiYCeCfXnI+/9iQG5OBpdAKd8irL6yx98rdt19r6AVQjRHXO846l1NpgTBQSK81SV6N9D/x6qGeqrXRrmHahzxHnjYxFgFDnvsyseLtcnsAABw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7MC8FyeD3iQoWhoUru8gZdJjdRC1HLcu2KHv7VaqJ8w=; b=e5NtZ3oULml5j9XnEIBbbmL9gb84lUBgRHRZOwz+x54vK+lO9GBKzlhsvUiJIimpru66RtUm0I4FNjpMfwymqxQOCRyWuiyh9Hv09iDJnCYFyq0daT1WM4CGnKV2t6ggFC5z3Xeb74UkIIMAh94ZppP4Zv2OS712GyO1+roCdiA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by SL2PR06MB3050.apcprd06.prod.outlook.com (2603:1096:100:39::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Mon, 13 Dec 2021 09:43:19 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::a0cf:a0e2:ee48:a396]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::a0cf:a0e2:ee48:a396%4]) with mapi id 15.20.4778.017; Mon, 13 Dec 2021 09:43:18 +0000 From: Qing Wang To: "David S. Miller" , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] arch: sparc: add missing of_node_put before return Date: Mon, 13 Dec 2021 01:43:06 -0800 Message-Id: <1639388586-63750-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9fb01015-5292-429d-f26b-08d9be1cfe70 X-MS-TrafficTypeDiagnostic: SL2PR06MB3050:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hj/QjeZvlfCzt0LQRUq9PvJHicXDLCCLbET6PZ1da7cP4XywKaqVpu5kvES4xJf7fkfDWbpqLYficn1tgcUBRviGBAKKnlrgxQTr6ca9n6RjI6WQGFG9Fd04r/b831Xl0rN+jhdeTxZofZGOMbuYnvQd4AcRsOf6pSRQ5hLg+2AZYCjxnNF7HB0ySL1Pce2b4/aniwghdkf1PXYMjooJdQMUiL8P3N9x1SoNlUQZCQ00zVKMNBY7j8XbnaihaFkceYy5XYg8eysZcf4xaPbRarDMPTQr4ldpuZmG1odqA3P7cZBru4BViODcNA+GuqrI+9nlFq4zwVjVbmFlkduePwociEJW03LXwsmpaFjyKF1xs9bIJ/I+opf4eYR35dHMyXg1ZHYeq+GQh5ySpugNM2mV/KfiaSs4DaBS4g5VnYea3PvAba5RuYmNWV+zj5E6Um/fsbPY5qEf6/sTjdVEjm0y0vHiDHDjlv7G2pyzkajVpjjPqIRkxM6h/QHrPL6o21Q4yCL7tTdlfZZafDcgur7tTDsXrpawaEziUYkBPa0NKIzgxWP6QjASxylm+m8HR7T9cqVyGX1fjTxtZ2IEaouBVk67Ceov0Yjo83+zhfrXCBzD3DTWir3opbnmADO5295cAIbeRlR1I00ifCB/gjYmGMjRoKe9vsIBTcPXwb4S+r+h2aclm5VDGGRhNXUiTVIdQnUPpkQZcwvj0JQLZg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR06MB3082.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(83380400001)(52116002)(6506007)(2906002)(316002)(508600001)(26005)(186003)(66946007)(36756003)(107886003)(66476007)(2616005)(66556008)(8936002)(6512007)(8676002)(4326008)(5660300002)(6486002)(38100700002)(4744005)(38350700002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7w2J7QA7ABKDpR9nWlBUotvFfEX6Y6G0D9j65e7nY+YxD8kMOdomDMsKmeLTsP6U8Thntt2F5OtJidNjJfzGaFxDrCZY1vQK9iLbH8r8rmVNM87qjo2UYWlrsg3J/us/+bzJjPTRbzheSVbdcPKpkCs3OFxIzdaDMvL58YpObrb28Cwnaebv0of6LxOqhtYfqv/rRlvpBcdCYloOmCWrrC998ZH1WkG3EJCfPN+LKDZt07cT2MaFe+sYseRK5pubalgv/AkgOIGH16CSH5L6QdBcMZXtAvzq4JBIsvnmmbrfPR+XX9ALRod7gN8RqUiz3HqqIkSXrzATFFyVeSHdoSx4iOweOHuluiF5NaC0kY0waAuamoOWUJlYNc1LI7Xz78J3HExBzIRVMlxCJSwKOu2qGuzWEoFBgEz79xtX9ZNHYUQrp8XYNGlIx3FWxzdIfSaLjHrKGbqd585NS6Uu5RRLzzn6ERsefzhp5bOV0ITE/FtqA1h0dBeE+biTyoWCMvoloNZEaTASuKNDH9McQPfU9aFHC8nzr+9CK7mz3/AZyNbHKLZXWrzUD5rtOXVjjSPl1fgp860PKoTOxUPcpn7H5CE3fbm53ZXh0WSwbF9o5pNZyS89lTae9/3MKGCoOwjnluNwO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Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2021 09:43:18.8381 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ACkDbzZoH+Puy2amEW/6cTFFJYlCo3tOWmNWyyzsPbOhJ7tEC7rADYrbpkdvBS6RCLHb1p1DavXxdUwDdVBf2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2PR06MB3050 Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Wang Qing Fix following coccicheck warning: WARNING: Function "for_each_node_by_type" should have of_node_put() before return. Early exits from for_each_node_by_type should decrement the node reference counter. Signed-off-by: Wang Qing --- arch/sparc/kernel/prom_64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index f883a50..ed3e987 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c @@ -460,8 +460,10 @@ static void *of_iterate_over_cpus(void *(*func)(struct device_node *, int, int), } #endif ret = func(dp, cpuid, arg); - if (ret) + if (ret) { + of_node_put(dp); return ret; + } } return NULL; }