Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3943176img; Mon, 25 Mar 2019 23:06:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIYOtC4yqwrFMGErEuROz9GyIcl79wsvXN6CEmTV/7NbXQCqMag+uVnt2bUmxvsWQRwGqb X-Received: by 2002:a62:4e8a:: with SMTP id c132mr27364947pfb.24.1553580379847; Mon, 25 Mar 2019 23:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553580379; cv=none; d=google.com; s=arc-20160816; b=fGV3Wv+SDk0rL2P/qNGiCU4oZVqrmx3x2XvYg69RXqPigWqcS+z6Nbs+Bxm/DJbEV8 a6NLh/WVZiyOezzRZFUVesboTKaU4OF21L38+ioOAnaWl3X3ngj8589aJ2n+AcVZX+g5 Svd4SHLYgjVlfMzCkAJRfqNorqpKhWNT4OJY/vEA23dYQHUB2kzUQ5MKRsRLXfYB2oPX YY4P/9rTxyJzlC/b0dAoNEzh8AAIC057oy9nRy6ZfNA6GopuW/P9aBMgbCd9y0/GIdWX eCY6EvGBDgy/r5Sq1lmgaJ1cVfalqjuDQNjhNcFxAcNrWpZ2705+qFtvyi0C86o9ByVo TLLQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=s7rz+ZTrZk0iy9n7oZR5e17q+ZAS0q6r97WmT/cWfbQ=; b=VB6GC5Xgjsn1RVwG88ylbajm4TIetuFlXM5T8AYuGJQThU1zwFfgzOy9U7Vg+aeGYf SrbtywmJobSgR5QvQ1N/KLRkT7gDBikZ9dYYi4EzIAZVpS0kCdRk4hlDD+eBbDqBQl9e zRJpX8ddB0hW7DzvZbXi1JPPfI8DbaApoNwneMH96/kcuGXGwgFOCVzajnIRkbp18FtG hosoMF9ydGhW/fBBC5Gnr95XWv0hVAp/bCV3dGr17BPpX11si941DNVMXk516ilIUxcl 3FsvzZlSi3c9kCbDbVcjiiF1dO+ZnDpDvLxLo+A6/B/EcvJzAyFaMb4XVKQ23UUBq2TY Itpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=ImTSDzAc; 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 e1si7212138pls.228.2019.03.25.23.06.04; Mon, 25 Mar 2019 23:06:19 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=ImTSDzAc; 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 S1726299AbfCZGF2 (ORCPT + 99 others); Tue, 26 Mar 2019 02:05:28 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:28315 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfCZGF2 (ORCPT ); Tue, 26 Mar 2019 02:05:28 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44T0wj6F6Mz9v24W; Tue, 26 Mar 2019 07:05:25 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=ImTSDzAc; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id m8613gtAmuAq; Tue, 26 Mar 2019 07:05:25 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44T0wj4ttWz9v1Lc; Tue, 26 Mar 2019 07:05:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553580325; bh=s7rz+ZTrZk0iy9n7oZR5e17q+ZAS0q6r97WmT/cWfbQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ImTSDzAcpy/+8yz1nndpOtczJgIrTBU2Hdt4PK8pCDwIHdt57VRmT2Wgk3Rly/kpE 0n+tw7SfI0TBpH/Sv6KnqUARCp5DGysHglIUtbtRcKCbzONUALCKjroP153L2TF5GG Yt0o+gem3KDU86WVpPGS+LSMJlh/XCudEoM+jpho= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 77F688B77C; Tue, 26 Mar 2019 07:05:26 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id a_0wNBFWpLlS; Tue, 26 Mar 2019 07:05:26 +0100 (CET) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EBAB58B74C; Tue, 26 Mar 2019 07:05:25 +0100 (CET) Subject: Re: [PATCH v3] powerpc/8xx: fix possible object reference leak To: Peng Hao , vitb@kernel.crashing.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Cc: Wen Yang , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1553596191-78889-1-git-send-email-peng.hao2@zte.com.cn> From: Christophe Leroy Message-ID: <747f819a-9b1a-55c9-c0cf-860c75e5855c@c-s.fr> Date: Tue, 26 Mar 2019 07:05:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <1553596191-78889-1-git-send-email-peng.hao2@zte.com.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 26/03/2019 à 11:29, Peng Hao a écrit : Could you fix your clock or clock setup ? This emails appears to have been sent today at 11:29 (Paris Time ie GMT+1) allthough it is only 7am at the time being. Christophe > From: Wen Yang > > 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. > > Fixes: a8db8cf0d894 ("irq_domain: Replace irq_alloc_host() with > revmap-specific initializers") > Signed-off-by: Wen Yang > Suggested-by: Christophe Leroy > Suggested-by: Michael Ellerman > Reviewed-by: Peng Hao > Reviewed-by: Christophe Leroy > Cc: Vitaly Bordug > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-kernel@vger.kernel.org > --- > v3->v2: set ret to zero explicitly. > v2->v1: add a Fixes tag. > > arch/powerpc/platforms/8xx/pic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/8xx/pic.c b/arch/powerpc/platforms/8xx/pic.c > index 8d5a25d..9993998 100644 > --- a/arch/powerpc/platforms/8xx/pic.c > +++ b/arch/powerpc/platforms/8xx/pic.c > @@ -153,9 +153,9 @@ int mpc8xx_pic_init(void) > if (mpc8xx_pic_host == NULL) { > printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); > ret = -ENOMEM; > - goto out; > } > - return 0; > + > + ret = 0; > > out: > of_node_put(np); >