From patchwork Tue Nov 20 14:01:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10690651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7035813BB for ; Tue, 20 Nov 2018 16:03:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E4E92AA95 for ; Tue, 20 Nov 2018 16:03:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B81F2AAA4; Tue, 20 Nov 2018 16:03:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87AAE2AAA5 for ; Tue, 20 Nov 2018 16:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From: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=kYJLQ1P34MFwjylYw38Fk6ILFL0na7F8b3wmZRKTxgc=; b=VH6 3Qqufn/jlS8vXMSAsBdZTy5J714ZuwVSq2fQPih6h0DlnBFu8TdMqUJDktLR7zJN2hjTQ5g4EMFpg vHgVFgbfxOOq0eQrA758su5XgVJ9DWNXsDq9Jc2APib2yqlpI1LWyRTYXdqYUV2GfM5on2PWMv+ba GiClMNaQg8thSi6HnVHIaoIMWMbBvZ/lkc4ft8tGsud2wrGqkHP3y2Mp88xA0cU5zmHvuw2Vnk6Vk +w8Uas4lcdXvLOw2o/JERB2KIi/kgmjGw3qEqvpQYVuj3HWiR1DH+rY4bFy8aMmJUtCh1FPU02sVY X/zrllNYKPikwP7cUFAVZva+hA3xz5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8UW-0008Sw-Ry; Tue, 20 Nov 2018 16:03:08 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8Fx-0003nl-7A for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Nov 2018 15:48:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6pmlTDFihEBurm1dLJqxoC6KqTTJxAXpBV9ussy6bQU=; b=x9pGuDiOrUs0vxbtH79K8BO4f 0Xenp0SKfUtBLp+zxsUPFS1FQKIli4nveRhv0R8BqgrXAPLqrqVgZXAL9BwiHQdFtzq/M6hSs2xmY QkBaECCbCi6voY0mAQ59x9prYK7v4YxSL2AYaDMge1mT3vgAOy4WHaab6sn6CVDZJuB0poI2nQ95m 5H8QdtHq5BGbFR4mH5V5FYTA4eUjIXTjktZgNDpNnmYa8IbBBuLzZu74urgJslWpg8udaHSrhGrxp p7jhZdWjXZt2hIroDzofH8tyFVnApSawEw7b6in6dgHJpKeUU+hZEOxqjoDcKw4VVVvYZmrvY0nhr OS9NiMX5g==; Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP6bh-0008MX-1s for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2018 14:02:26 +0000 Received: by mail-pg1-x543.google.com with SMTP id 70so943428pgh.8 for ; Tue, 20 Nov 2018 06:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6pmlTDFihEBurm1dLJqxoC6KqTTJxAXpBV9ussy6bQU=; b=GJh3/FBvAImQxMJCmTqAUB+F4ewRctJxtZTladXv5ZCfji4jkAQwT9VXE0Vk+J1H8C XWPTEvztUZ/272eQNE1WEEueMz/aFV1SIA+7Uy2wSVOHH2Rcx6YNrwM6rRuR0at6wJov HvVorEo6o3ArmxryHePMvKq7z/KnCnCBcrQEeUgF7Uxed3AgEZzMmPYmUeDQg8iyoznE 5n2ILqpYY2KzqSfp+NDmvt91IKIsVvheV6tvlS6pLCkqoUkUQRPFhQSGpWEfcj93YkqJ 1iliHRSSi4G545CxJvQSqFL9VMTL0gOOMSA/mZQgInuCRWTL63MHG57HZW5kpRNVYlF/ 6D4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6pmlTDFihEBurm1dLJqxoC6KqTTJxAXpBV9ussy6bQU=; b=RhqI8V50UJeyfmrKWrv43nrzdLCPWOii96Hig0DKyBSPc+SqtUqtHhWAy53knVa6HB Gagqg2GdgwAntsqi4ZuKkIvrZCUVi6GUjX2tPMwSyM3DKe/sWminD/mHo6KOuENlQcAH l3BXt5xV1n5Yp49qIiKiU2wuzZmwPYBzEHngQ7Ewe0y8PfaaJpgvyXBMe8FMFVVR+paj ibm8xvwvxV+hrPDY1FvpSrIVR/TueHLzkMzEEZc9+F7Ctxozy3gFVIxib40A1LUGmuqM uvY2fBtAx/vYnjDUuFx8FAh4ZSMbio2WeVk+BQTKn9BcIHNRA0GN0ET/ZxL9JFLfQXWQ WQGA== X-Gm-Message-State: AGRZ1gLeOrT1gDUp9N1q8V7J02FnQ5QU1kBVpCd0e4N9lVuKUCxg4bTm 1OLi1DyspmhoOWPHoZmPQuE= X-Google-Smtp-Source: AJdET5eJMztj/Bls5sZ/jGrj0OwtfBCdjpRKYRIOm8+SU0OKdhgnFIhU6dq2rqiv4ptr/YI/ivQA0A== X-Received: by 2002:a62:1a44:: with SMTP id a65mr2366212pfa.30.1542722473030; Tue, 20 Nov 2018 06:01:13 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id i63-v6sm9551776pfi.66.2018.11.20.06.01.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 06:01:12 -0800 (PST) From: Yangtao Li To: linux@armlinux.org.uk, akpm@linux-foundation.org, rppt@linux.vnet.ibm.com, robh@kernel.org, mhocko@suse.com Subject: [PATCH] arm: add missing of_node_put() Date: Tue, 20 Nov 2018 09:01:09 -0500 Message-Id: <20181120140109.20334-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181120_090225_293933_6145DEDB X-CRM114-Status: GOOD ( 12.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP use of_node_put() to release the refcount. Signed-off-by: Yangtao Li --- arch/arm/kernel/devtree.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index e3057c1b55b9..9576adf0d15b 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -101,7 +101,7 @@ void __init arm_dt_init_cpu_maps(void) if (!cell || prop_bytes < sizeof(*cell)) { pr_debug(" * %pOF missing reg property\n", cpu); of_node_put(cpu); - return; + goto out; } /* @@ -115,7 +115,7 @@ void __init arm_dt_init_cpu_maps(void) if (prop_bytes || (hwid & ~MPIDR_HWID_BITMASK)) { of_node_put(cpu); - return; + goto out; } /* @@ -129,7 +129,7 @@ void __init arm_dt_init_cpu_maps(void) if (WARN(tmp_map[j] == hwid, "Duplicate /cpu reg properties in the DT\n")) { of_node_put(cpu); - return; + goto out; } /* @@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void) if (!bootcpu_valid) { pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); - return; + goto out; } /* @@ -184,6 +184,8 @@ void __init arm_dt_init_cpu_maps(void) cpu_logical_map(i) = tmp_map[i]; pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i)); } +out: + of_node_put(cpus); } bool arch_match_cpu_phys_id(int cpu, u64 phys_id)