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 17873C433F5 for ; Fri, 10 Dec 2021 08:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235452AbhLJIPu (ORCPT ); Fri, 10 Dec 2021 03:15:50 -0500 Received: from mail-psaapc01on2130.outbound.protection.outlook.com ([40.107.255.130]:62337 "EHLO APC01-PSA-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231337AbhLJIPt (ORCPT ); Fri, 10 Dec 2021 03:15:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EeIJPcxusXu8jXp0NP+9R11fhf7vzZiVwPGuLwp7j73rMmlxiwKICvEBzU+424pjOYf2pzxgGSMBvGjqGOCIiKtzEnMv1Go+QHsufiWmynL+zKHlWnqiIzNtvW0E8supoZ+q18+9cv7d7M2z50eUAu9KTNI+5egwpgJ4uvlxIxFI9HnasbzSsbcZWT1QfGN36gXXvaaBpBFMjDJCXDyPsUYyC+RW6wyegDzeBY4Ba7BJLzD7TpS+2kCxdahfbpbRMOBy99BmsvbW8jv5XSm9CjJRHG8V5jWc8SWKXvWuOAoUDx5FRZDvJG8MfqmAW3iYo1n0ODuil1wQkv1KyVvM3w== 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=IRfj/08Z/+sHVMJs6y3DCcs/iNehE7cY6dekcJu6KRA=; b=TWpT1l4jehYWCD8FA6VXzuDllt9AMTXep8mTiduqMY9TK1/827mMlcCPzaJXVEN1XPIVDZKuNdL1wt7mGSDO1EKjBNxfrIsWO8LUTyFp5kEM9LOnI/Emsk/CzXOD2i3yclxXgrRiNf1p/WVpMaHTKIf5NTxylsq+nYvaZ61skVamFGRLQB/XP1YXcdIGrBt47Ug+yF9yT+jHCLLayXEoP2TV3+8VDjhvL6K5DCot/4qW56EwaH1LhzSIDl6GbBdsZgXDKxwN99Eeu9xLw743qzupvIWUjrOCakeQoRq/pBwWV+L6mnTBQzzMWLoPl3Ugp+Xl/iioOrAGX5reTr0lmw== 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=IRfj/08Z/+sHVMJs6y3DCcs/iNehE7cY6dekcJu6KRA=; b=kMcKp3vkmk/+Mv+hVEpW6WyZNFUBmB9TvAZvozUgEXwuxHf75uWwj2ghk0duPzOuMTFvoUbO35A6UhQHYQoY3YvA07jwst7mQcbrWoyg2R+p9KqKEFfNgfkR5BiXkoOUC0duKmEgPPgQzowkbxiWicmZxuaBuTYWLQug3vd0fkY= 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 SL2PR06MB3033.apcprd06.prod.outlook.com (2603:1096:100:36::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.13; Fri, 10 Dec 2021 08:12:12 +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.014; Fri, 10 Dec 2021 08:12:12 +0000 From: Qing Wang To: Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] powermac: low_i2c: Add missing of_node_put for loop iteration Date: Fri, 10 Dec 2021 00:11:51 -0800 Message-Id: <1639123911-31736-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: HK2P15301CA0002.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::12) 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: 55017e37-ad22-4937-e3a0-08d9bbb4c501 X-MS-TrafficTypeDiagnostic: SL2PR06MB3033:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HhoCedNLanEqL89s9Ihu3Siyvg1da6y563dz6Z7KQuVBPi2rX+bvV1EK9BzxXYwGKw0WQfm+Sqj30X5ksPq3QZs5uFeEX+2FpxlFOCZU03Xbv6CCPe1rS35+vq8xFVQuZbeSrL+7vnOJDiJiqGIeoN+I6k25mEd1sCR4UzGyaY743HqKXRTqb5c+r7dBIXebQkBTnLvaK0GC+U5/7SZ/Ld7BebvwQN/pTqAc97ROSufTx/koN2k2rm+r0d56GTIu3rq2Ixk5kQ5p1ipqJTga4PWgrFJZmzOJWYdvSk7yeqXa/YZ10W08p4S1yZU8vO65hxXdYoNSuioqqNOhyrfQslvxtN/3OdmnWy/OjFI7eZkAdJNP4YYdjvFdk9PNOqttumkXNadPLe9KoA0Ye1vCChrexVElT8A9dQoYey1C2OZn8xz/xOr6vX9MrR40LnWTLceXREfUJQiWKKUGP7V2aQJQHpvYs9vwY22g4o/fbMlfZkLBXcs9sW6/X4mlUAZ47BVDnzSn1sWTDFMxSe3tMvVQI3NH/23T+ti+N+fQkhKZTyNdcf5rP0u7wH/sdltRLaGtFTpmqJUb1sGMBw04lw9M06EZndiXuQxR9JeAFfpcjw//vxhxLX+xjq8xfhh0/G1iEhfDCHVZibm8rREWs6TJ676nTqNm58GgFttEUAyxuf/88eE+dxJa6OAZChJx6q9vkKK8wBllUsPYTekJlA== 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)(8936002)(186003)(66946007)(66556008)(66476007)(508600001)(4326008)(2906002)(5660300002)(36756003)(110136005)(52116002)(6666004)(83380400001)(6512007)(6486002)(6506007)(38100700002)(38350700002)(4744005)(107886003)(2616005)(8676002)(316002)(26005)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6dFExIfx8JtFl6uawMHJO4dHm4Utjz8E11yc9lAbCKb5iFR1VlCzk2ojmEk3?= =?us-ascii?Q?kPW10D2T4pXEUqBSxLcaugbFJ83cKm8aVTUNsGlwiovyAHAaS+kTKP2W37PG?= =?us-ascii?Q?CJQi/rKM49cJq+ylqT85rrdEoeQfTyTMy8ytijdjInblBH+OlYPc1mLwtpdo?= =?us-ascii?Q?bmHpj6nos73G1TylZ9WLZTzwnqqWn94/ImYyK6wsr3WRcIadfR2aZI8QswOh?= =?us-ascii?Q?iNuroi3JUqxC5H3/aq0Fyh6tLx6u6zG+6EUurnhovIztkkD+gGIYYKUkXIRg?= =?us-ascii?Q?hGTox2HhXv6bQhHaw7u6euFOeFbFv1Vy/6Yi9wq54yW0fBZs87tblxZWWobr?= =?us-ascii?Q?A3oV3a2QXW4lsz/vqben0ApKCJ7M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xk7N9jWl05zF4NlmDKi8WfH2sDvw/T+3Y6D2F4HEi7qavhKMDfoAMXIuN?= =?us-ascii?Q?UNU88/ssTE0ljmJP6UJhDlZ41uUYfqni3iyovSjKq3uUwLiqS/2OEIoIdkTb?= =?us-ascii?Q?O2eoQBgxSjmAs7puA378wVYMMVktH2FkdPJI4BWQnPAKe/1XFc3lYWh8bUuj?= =?us-ascii?Q?BgltsLQA6n1z3JkDo2Kk4Zl5GfWGzFMtzvZkPhO+dwcyr8fufAcBm6SKbssr?= =?us-ascii?Q?cqaEeF/q5H7IdbYCtvIE2D6svYfJFsuDHmZvICOx1k/7E3P92oyDWDziRtGA?= =?us-ascii?Q?Are1FAkYmd2LYG97R3L+0jaXxIeK/39kYv5RnhndK7VMtLpddRa4HgoAnd6T?= =?us-ascii?Q?BUbiF/bjAOpg3Lm+AEGOkJA=3D?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55017e37-ad22-4937-e3a0-08d9bbb4c501 X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2021 08:12:12.5677 (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: xl+HfWgVM7T0HpkAgWEPFv4d/WPtj60z2Lp+IBWHqcuZBVz86DFAn+cIF8rAG2gJZFKbJVJxi+PHOGaZmqfcjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2PR06MB3033 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Qing for_each_available_child_of_node() should decrement the node reference counter. Reported by Coccinelle: arch/powerpc/platforms/powermac/low_i2c.c:916:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return. Signed-off-by: Wang Qing --- arch/powerpc/platforms/powermac/low_i2c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index f77a59b..5a8c306 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c @@ -922,8 +922,10 @@ static void __init smu_i2c_probe(void) sz = sizeof(struct pmac_i2c_bus) + sizeof(struct smu_i2c_cmd); bus = kzalloc(sz, GFP_KERNEL); - if (bus == NULL) + if (bus == NULL) { + of_node_put(busnode); return; + } bus->controller = controller; bus->busnode = of_node_get(busnode); -- 2.7.4