From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3v69ZQ45mdzDqXh for ; Mon, 23 Jan 2017 10:26:54 +1100 (AEDT) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0MNIhHB122600 for ; Sun, 22 Jan 2017 18:26:52 -0500 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0b-001b2d01.pphosted.com with ESMTP id 284xeq4urk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 22 Jan 2017 18:26:51 -0500 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Jan 2017 09:26:49 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 7F97E2CE8056 for ; Mon, 23 Jan 2017 10:26:46 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0MNQf4F21430376 for ; Mon, 23 Jan 2017 10:26:49 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v0MNQDcZ016688 for ; Mon, 23 Jan 2017 10:26:14 +1100 From: Gavin Shan To: linuxppc-dev@lists.ozlabs.org Cc: mpe@ellerman.id.au, Gavin Shan Subject: [PATCH 3/3] powerpc/kernel: Fix unbalanced refcount on RTAS device node Date: Mon, 23 Jan 2017 10:25:46 +1100 In-Reply-To: <1485127546-18859-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1485127546-18859-1-git-send-email-gwshan@linux.vnet.ibm.com> Message-Id: <1485127546-18859-4-git-send-email-gwshan@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , The RTAS device-tree node's refcount has been increased by one in the function call of_find_node_by_name(), but it's missed to be decreased by one in the error path. It leads to unbalanced refcount on RTAS device-tree node. This fixes above issue by decreasing RTAS device-tree node's refcount in error path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index d13b92d..0823fe3 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -1158,6 +1158,7 @@ void __init rtas_initialize(void) no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); if (no_base && no_size) { + of_node_put(rtas.dev); rtas.dev = NULL; return; } -- 2.7.4