Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3270728imb; Tue, 5 Mar 2019 05:25:36 -0800 (PST) X-Google-Smtp-Source: APXvYqw0aNuDmQUekLbKfipfFQ8uOjonFmmEu4KNDOt4HnQo1YlAPQX/5SIZNKfiCac3k2n71s3o X-Received: by 2002:a63:3648:: with SMTP id d69mr1413946pga.314.1551792336830; Tue, 05 Mar 2019 05:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551792336; cv=none; d=google.com; s=arc-20160816; b=QZVILosoqXAK7cUd0FrDPeyZdekJAQ8Rffj/J0G1c1xQ5b/bBXDmvWm8tfzlzA5mwa pnv8i/ZmCj2tw8xABIElkol3LKMN5Xxj1KCbny9QX5XCH+xfs0lf4jR1OngEARSuW/t9 LhZf4ebXy2623sP9gGXR1YboHKvTc/YNqL7f9rXTiLUL4bwYQBOmibNCDdIFggl/E3gC 8M0JbdHmM9YymjX+/i+mKVvlmdSNGQfeGPIlXnwBtW4H/o/cU7Xdo97ncvY0l/uprI5P l2AuBpJi3VxD7wCVAqZfhu9D8mZkrAYGr2mL4j0fUQdhhFPl//HGsixAhmf9A6kTXBar awkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=n6Sxk0Eh0VFUF3sZfJ+5TBb9CmuGD1vZOoBXNrHolBk=; b=ZCVtyprRotpwG5Z+CFvSddW/++NU0JErLkMpq7zyh2SVpTrLdQddQ53g5TTj5/KrpB ZppH+25avo5xrhGGPnr7PgTrXL8VydnaDPlo7zbjW0TnXfa4hmoMnn+y/Xtr6ADgocyG 9+AS9LcUbf4pdM4xkD3eoyoKzm7lsuIC0KG4QOZlJ/2Qaqk6NijiwWTDDWpYud3AH8W2 FZkiyC1iCPEfk1EpiCnK8sUQYYM852mEoKis9KMpvJgo0BmLDxI0JqiYmqIgMMf7T31b mHcb/Rcz/C/TwcCVozR8DXC6HnO+rly053zOjFBYV4EAPaqbAX88XI7vz1Ma6iNj22rF kT4g== 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 cn17si9060385plb.139.2019.03.05.05.25.21; Tue, 05 Mar 2019 05:25:36 -0800 (PST) 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 S1727948AbfCELdS (ORCPT + 99 others); Tue, 5 Mar 2019 06:33:18 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:41628 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbfCELdQ (ORCPT ); Tue, 5 Mar 2019 06:33:16 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 2DDB48AC1D2DE8684F20; Tue, 5 Mar 2019 19:33:11 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x25BX3XV072444; Tue, 5 Mar 2019 19:33:03 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030519331902-3291608 ; Tue, 5 Mar 2019 19:33:19 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Dinh Nguyen , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 09/15] ARM: socfpga: fix a leaked reference by adding missing of_node_put Date: Tue, 5 Mar 2019 19:34:00 +0800 Message-Id: <1551785646-46173-9-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551785646-46173-1-git-send-email-wen.yang99@zte.com.cn> References: <1551785646-46173-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-05 19:33:19, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-05 19:32:59, Serialize complete at 2019-03-05 19:32:59 X-MAIL: mse01.zte.com.cn x25BX3XV072444 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-socfpga/platsmp.c:93:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 85, but without a corresponding object release within this function. Signed-off-by: Wen Yang Reviewed-by: Florian Fainelli Cc: Dinh Nguyen Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- v2->v1: add a missing space between "adding" and "missing" arch/arm/mach-socfpga/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c index 0ee7677..55c2884 100644 --- a/arch/arm/mach-socfpga/platsmp.c +++ b/arch/arm/mach-socfpga/platsmp.c @@ -89,6 +89,7 @@ static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus) } socfpga_scu_base_addr = of_iomap(np, 0); + of_node_put(np); if (!socfpga_scu_base_addr) return; scu_enable(socfpga_scu_base_addr); -- 2.9.5