Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp273995img; Thu, 21 Mar 2019 20:08:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu1ncM0RhGCdsuzNypXmXktyBRf/0/TxhKqt/dTLSxbZO2NXtKW3okyL+8SI6P8Eipo+0I X-Received: by 2002:a17:902:b43:: with SMTP id 61mr7048768plq.83.1553224106335; Thu, 21 Mar 2019 20:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553224106; cv=none; d=google.com; s=arc-20160816; b=ibrKPV354/kTIdncd4eaejbbDpvEWTZkp6UmEBYbWu5BkiHAbeT7s1rWFTyDrWo8lQ Wco/I+w4N/tVX8OhGb92aB1Tf7CWyGMqSE7wb7tIzeQ/uJxuFaVtNCosaZW+09FifpPC Qrs87afg4/TYBpbXlVDR/Sxjb+Z5VPUGwsWN0ZVu38r4L6vVIHhj48TlNFcbABkAtLg7 xnDjzy1sf3kf2E3Q+ldLBf6uTZD5iwgmJDKEiiKgq8H0EcATnvENOpVsytLH8u5m5eQM xgcbsthv3Y5gC/J1Iwz7p0Ah1S67SykwV5u9BAikVGf1fqF7uIVZrDZuEl9uo1yBhCa0 aShA== 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=43EDza/B8mamaPZejhPUyh+S63P/DT+Uj35MhyzbQtY=; b=KPqRl5T+FIEsERQ3VDEDME50ekEn9fAC+B3QS81yFV00rBs2NhzpcD0ABzpDM045ue mQIywuiwHb5lOK3i/hxIYPyYp4iuRj/JHLVohOK1WVRJEWQGTDy1/k7qvjJGFS9ypvEP HoEmLOpdyU79uEGbo9UxPl69+sPDG0uDfL9eYGqVMOZRcwYeRAHFOqO06k4Ep8FVypz5 01KqK2MRFge73+wRBIe5G8i0uREe+1ng1oEanSmk9V05TVmlwByt1U2cGHI/0N3vTPdv tOLdvIRnHphf6inEcJJ6EGnNxfU5yWoZJjYvm+gcxRGfDGapb2TRWwoGkmb8qAk2CjXr 4zCg== 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 c15si5672006pgj.13.2019.03.21.20.08.09; Thu, 21 Mar 2019 20:08:26 -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 S1727685AbfCVDHS (ORCPT + 99 others); Thu, 21 Mar 2019 23:07:18 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:39460 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727651AbfCVDHS (ORCPT ); Thu, 21 Mar 2019 23:07:18 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 5F5AEA743C4413AD96B6; Fri, 22 Mar 2019 11:07:16 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x2M35qS5078123; Fri, 22 Mar 2019 11:05:52 +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 2019032211062866-5922987 ; Fri, 22 Mar 2019 11:06:28 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Vitaly Bordug , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 5/5] powerpc/8xx: fix possible object reference leak Date: Fri, 22 Mar 2019 11:05:55 +0800 Message-Id: <1553223955-7350-5-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:28, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-22 11:05:37, Serialize complete at 2019-03-22 11:05:37 X-MAIL: mse01.zte.com.cn x2M35qS5078123 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_find_compatible_node returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. irq_domain_add_linear also calls of_node_get to increase refcount, so irq_domain will not be affected when it is released. Detected by coccinelle with the following warnings: ./arch/powerpc/platforms/8xx/pic.c:158:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 136, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Vitaly Bordug Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/platforms/8xx/pic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/8xx/pic.c b/arch/powerpc/platforms/8xx/pic.c index 8d5a25d..13d880b 100644 --- a/arch/powerpc/platforms/8xx/pic.c +++ b/arch/powerpc/platforms/8xx/pic.c @@ -155,6 +155,7 @@ int mpc8xx_pic_init(void) ret = -ENOMEM; goto out; } + of_node_put(np); return 0; out: -- 2.9.5