Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2514136imm; Mon, 24 Sep 2018 05:45:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV62W61DWm4F1h1ph6V4MPKcMrQFv1HsBNDaHpyQjkx6e/4SLzs34ZUL5U4bfq+6riD6yP0U2 X-Received: by 2002:a17:902:ba95:: with SMTP id k21-v6mr10627743pls.38.1537793118443; Mon, 24 Sep 2018 05:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793118; cv=none; d=google.com; s=arc-20160816; b=IVnLsONw0HMHOlIFWTcghS250IpSCwaUjyrXx3JH378xWJ1HLjoDFBAZIszco8399O CxEEokBrqHStI7JLGMLKelWcuuChYKwIv+QQSdUWJ++9DMwhOG8two3gsjmRfMjW9XK+ OSvlWGNdQiLybqwblbcrswZBh2qZY3UZ2bc/Ul+qw9C+FRoLbjhZA94iSoKIDeL2jSPb /N4pwat+Ml9sQdeG8c6Qa7hMi43f0nsMQkB2aSrdN5R9Yju95BKBdH3kWno1rSORlkZe 5eu6gJRBEHUhfF7IIujdwdnGUJQk41HXg9KzwwRSZYmtUXN0o25Uo3JrWqhKJ0sbD7Hm 8KXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=MQ2z1WRahwh8/U+3u20S4TxXqkkZOKXB+jq3HBHU2Kc=; b=GkFCqjmdDKn7KDsLny1czgvu1g7JReAcZH6P6KIC3xBiREJkT9t4T/kJOcdyemlVZ9 vabJ0J9vD3VU8+gRReJ86ZK2LC3ERQGft2XU7QvlRpgEisO844GqrrswMtwRGZDKxmdn r90D6TdWH6tyu+aB9OhNq5J0BLmWRiCfCvXcmuyfZsRySrZyvlT3iLH72lrWi6LelQ10 +wuy1CspR07J9SeishknaKDdtCSOfGJ+HI2JSwngt67Vj65EZXxJ+K3M48gSZ5oSUSyE ahU9+AzgqELi5qtm6sy1Bw/xu/nDSggMGxMNvnxS9opNJDkC3x7ALiomEoBD6L1FQnJr O72A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7-v6si37682659pgf.231.2018.09.24.05.45.03; Mon, 24 Sep 2018 05:45:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389105AbeIXSqB (ORCPT + 99 others); Mon, 24 Sep 2018 14:46:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59538 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732481AbeIXSqB (ORCPT ); Mon, 24 Sep 2018 14:46:01 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9A514109A; Mon, 24 Sep 2018 12:44:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Mc Guire , Wei Xu , Sasha Levin Subject: [PATCH 4.18 171/235] ARM: hisi: fix error handling and missing of_node_put Date: Mon, 24 Sep 2018 13:52:37 +0200 Message-Id: <20180924113121.983233144@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Mc Guire [ Upstream commit 9f30b5ae0585ca5234fe979294b8f897299dec99 ] of_iomap() can return NULL which seems critical here and thus should be explicitly flagged so that the cause of system halting can be understood. As of_find_compatible_node() is returning a device node with refcount incremented it must be explicitly decremented here. Signed-off-by: Nicholas Mc Guire Fixes: commit 7fda91e73155 ("ARM: hisi: enable smp for HiP01") Signed-off-by: Wei Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-hisi/hotplug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/arm/mach-hisi/hotplug.c +++ b/arch/arm/mach-hisi/hotplug.c @@ -226,10 +226,10 @@ void hip01_set_cpu(int cpu, bool enable) if (!ctrl_base) { np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl"); - if (np) - ctrl_base = of_iomap(np, 0); - else - BUG(); + BUG_ON(!np); + ctrl_base = of_iomap(np, 0); + of_node_put(np); + BUG_ON(!ctrl_base); } if (enable) {