Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp274409img; Thu, 21 Mar 2019 20:09:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqtOBCcG8WcK7Yk9zE910W8rheaRdM0jeEE7RsQcFpH+yUm6vx8nancheogQwxcdjNYpaH X-Received: by 2002:a17:902:1101:: with SMTP id d1mr6885542pla.19.1553224147316; Thu, 21 Mar 2019 20:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553224147; cv=none; d=google.com; s=arc-20160816; b=q5CvDdveBgi8rNyBNshvCYn7eWgRrn30TT0oc8NeCYo+05EcQ8fQKpsXT7j5ZckPNa 47X1cz2ksVvgLIThhgP3PnQ7X/TIVjuF7Sov9NFGlL20LR1NHoVlAUDJQDJM+jNWdDAr +DMAqI1228zuv9NM82dtyOZQymS3pzh7EK/G+hwEXtJ54K/AGZ/kK0063gTWIRRZ1ngl QLNdaUIOEqQSs4GCo3JkR8yeaBRG3CExzUnemVyy844sXMIt12QsQBqKtjyRsHIEF9bE lUJ4NCM6iDX0/IJSsUGk/6ryMRngN1cQjwOtq4TyaG5uTn8yB+sq1t5epndvfZHJvrCS aCbw== 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=tJIRP3S+uQlVZjUG6rWo3usw5u0gXZYqELeJVML8ItQ=; b=snTp7Y2N6uq6MhrttbvLE8IncjyFyXyZHstgle08aeF7rxAF+78hmZz798zMhsH58d MTTuVbNUXbLFkgv9bbN34j9LRvsFKThS7EJ6rYhK2K9UWDnnw0ZDoRmmgQ2gi0R4zDOi QL6dbTM7T1oqIxkL6bijsWpXqw5Td4Sj6UwP/GxM7lix2eQd8HDbsvJ86qg/G5vrxi/2 u2JH8rsMbn3WEMhdClZhyxJpqUav/98QuVLGRX57BeOHcCnJ6kj14+ikGqmNfe8gewFU yT+p/9qUhfeQonqpsVmQuko9X0gIZ90fGbeedtqe90V6a8VwHbuWdqqrAQL1kCiKlzZy gk2A== 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 n34si6232507pld.163.2019.03.21.20.08.52; Thu, 21 Mar 2019 20:09:07 -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 S1727671AbfCVDHR (ORCPT + 99 others); Thu, 21 Mar 2019 23:07:17 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:58104 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727576AbfCVDHQ (ORCPT ); Thu, 21 Mar 2019 23:07:16 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id EF639D0898BEB91D10D3; Fri, 22 Mar 2019 11:07:09 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x2M35lS2078047; Fri, 22 Mar 2019 11:05:47 +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 2019032211062412-5922971 ; Fri, 22 Mar 2019 11:06:24 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Scott Wood , Kumar Gala , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/5] powerpc/83xx: fix possible object reference leak Date: Fri, 22 Mar 2019 11:05:52 +0800 Message-Id: <1553223955-7350-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553223955-7350-1-git-send-email-wen.yang99@zte.com.cn> References: <1553223955-7350-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-22 11:06:24, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-22 11:05:32, Serialize complete at 2019-03-22 11:05:32 X-MAIL: mse01.zte.com.cn x2M35lS2078047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_find_node_by_name 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/powerpc/platforms/83xx/km83xx.c:68:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 59, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Scott Wood Cc: Kumar Gala Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/platforms/83xx/km83xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c index d8642a4..11eea7c 100644 --- a/arch/powerpc/platforms/83xx/km83xx.c +++ b/arch/powerpc/platforms/83xx/km83xx.c @@ -65,6 +65,7 @@ static void quirk_mpc8360e_qe_enet10(void) ret = of_address_to_resource(np_par, 0, &res); if (ret) { pr_warn("%s couldn;t map par_io registers\n", __func__); + of_node_put(np_par); return; } -- 2.9.5