Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3609102imm; Mon, 4 Jun 2018 06:33:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKYYIwQRe0+f4QVJHb0YaR/pOhf1YfTiT2HvEQFPZrq9zJp0EgOq+3nlVgnsdD8JyGuva7u X-Received: by 2002:a17:902:d697:: with SMTP id v23-v6mr13437008ply.193.1528119227129; Mon, 04 Jun 2018 06:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528119227; cv=none; d=google.com; s=arc-20160816; b=Gsr32wYPt8WwtdZKit0gfIe7AbjUVk5mqfjL7NRRBHKOitRik3cLup1kTAfWriYo76 dFPtR3NNXQXeufeXGvBhzCvnt1ARWF1MJ5jrAZ5SRuTOLs8WhLNIoNXg/jHDqZS/bjVu 62U/jSiok11UYNu9chNTmI0XoRMdwj/5IpzEmQLS8BWjsWkb/OGoi4OCowTZaHnrpiXw sj9ZLUPpc1UA5yiSixUyiBdcIWcvoWndpT85T8R3F22ivEkI03CmzykSoah91dAndoxl 8nDm/9MBvuOoTEExi1rON1clPN2ohi5ERnaQqzwmYWukTGNtdqD2SplqjEI2uB01AAR4 2JIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=pLML89Qazb/zw+Fcu0TLJLQrL52038rD6QrjgS4frdY=; b=Am3MDDgjprUL/AOAWF3dFEb/hCQJCNsuw0Or0Cr2wf2kbtW/FLGNds5+Ew5Dh/FBJD +z62gKPKg4uCvqyKU4ONAFyrMc8LFYcD5EA/PaGE5LkpO4sJacU1ly42BzeOrIOaYj8M dmGwtFuKYV3MsusjSxJWkhyfy21glvHszQQkkXYPPOs09pNVUFcZ4KhV0WO/tBowKZ2R 3q8WkIfx3TxkQ/MuJ0OGrYvQ2EFJfcSHETABnwZ/rpCxQWPDQRGsM2+I+805WSTTZsTC GkFF0VKKNP1j9R0nWMZ8mxUDJ4Od+Q1xWm7L9O1KuPeN4IXU7YkIfT0BkYctMjBfnyRS xJYg== 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 n11-v6si27605858plg.230.2018.06.04.06.33.31; Mon, 04 Jun 2018 06:33:47 -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 S1753170AbeFDNc6 (ORCPT + 99 others); Mon, 4 Jun 2018 09:32:58 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:11746 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753023AbeFDNc4 (ORCPT ); Mon, 4 Jun 2018 09:32:56 -0400 X-IronPort-AV: E=Sophos;i="5.49,476,1520924400"; d="scan'208";a="14899615" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 04 Jun 2018 06:32:56 -0700 Received: from localhost (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Mon, 4 Jun 2018 06:32:55 -0700 Date: Mon, 4 Jun 2018 15:31:58 +0200 From: Ludovic Desroches To: Nicholas Mc Guire CC: Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , , , , Nicholas Mc Guire Subject: Re: [PATCH] media: atmel-isi: move of_node_put() to cover success branch as well Message-ID: <20180604133158.jnys4jliy4d7rwpi@rfolt0960.corp.atmel.com> Mail-Followup-To: Nicholas Mc Guire , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire References: <1527859814-30410-1-git-send-email-hofrat@opentech.at> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1527859814-30410-1-git-send-email-hofrat@opentech.at> User-Agent: NeoMutt/20180512 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 01:30:14PM +0000, Nicholas Mc Guire wrote: > From: Nicholas Mc Guire > > The of_node_put() was only covering the error branch but missed the > success branch so the refcount for ep which > of_graph_get_remote_port_parent() incremented on success would was > not being decremented. > > Signed-off-by: Nicholas Mc Guire Acked-by: Ludovic Desroches Thanks > --- > > This patch is on top of: "media: atmel-isi: drop unnecessary while loop" > > Patch was compile tested with: x86_64_defconfig + CONFIG_MEDIA_SUPPORT=y > MEDIA_CAMERA_SUPPORT=y, CONFIG_MEDIA_CONTROLLER=y, V4L_PLATFORM_DRIVERS=y > OF=y, CONFIG_COMPILE_TEST=y, CONFIG_VIDEO_ATMEL_ISI=y > > Compile testing atmel-isi.c shows some sparse warnings. Seems to be due to > sizeof operator being applied to a union (not related to the function being > changed though). > > Patch is against 4.17-rc7 (localversion-next is next-20180531) > > drivers/media/platform/atmel/atmel-isi.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c > index 85fc7b9..e8db4df 100644 > --- a/drivers/media/platform/atmel/atmel-isi.c > +++ b/drivers/media/platform/atmel/atmel-isi.c > @@ -1111,10 +1111,9 @@ static int isi_graph_parse(struct atmel_isi *isi, struct device_node *node) > return -EINVAL; > > remote = of_graph_get_remote_port_parent(ep); > - if (!remote) { > - of_node_put(ep); > + of_node_put(ep); > + if (!remote) > return -EINVAL; > - } > > /* Remote node to connect */ > isi->entity.node = remote; > -- > 2.1.4 >