Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1973923imm; Thu, 24 May 2018 03:52:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqlcHIK8HLh+bl0FW/l7zXCJbREWGNCuODqliVYrmiyXu3nuVqaL4V5mlgz31POXvcDMPte X-Received: by 2002:a62:8345:: with SMTP id h66-v6mr6828728pfe.0.1527159121546; Thu, 24 May 2018 03:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159121; cv=none; d=google.com; s=arc-20160816; b=MAhSvtl+bBuZf/4VqG8SnmYMLVHXUhmqcUJznVpxSzdbGhVbDrwO2l1Wi5JwJ/PvKQ F8RENCB9J+sXxOTL74F95czKTzapLOO2UH2igf56A1+gs5Xd4ZwSsJ1tFSP5o+Ga3PQ2 /ctlEjP5mj27Vmwxox5IzqnUs20DF9Csvd1tg81U0wFikdG0kR1qJYtGBTNG4F2bRtVr TTKgEU8/HNorlnsCr/c08YpkTVFbBM7cES8/Q96eaalRN2tkfxlzxoIo9lKze+2q8qMq tFLeKTnPqDYwI+tM7bS8hiFKDV4MGNVUuOH2Qb17u4CmA6ABwWD0MZYNv/SF0AR2Gkh0 2Heg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=j/v6rHnjU5NgLYlrsP1n9nhzo9uD1e3t1nt9kD7HaZk=; b=ZGhbcMpbRRsRrQQoQtO+EyGUetdfqOBPwYHA669MkyyHbN8F/Py845j2Ww17jiguvO KdX8xMk2db0ueWUiZ+Edngi1xh0vXC+5cTc0aGrnCumVGFCi7Oa4SklJ3DktUlIrzXEA aM8kz+UMIAwSNc02xGXacOB3flwNZ4ZLdzsL3ax9PBU3FUCyBNxPZJCaaGKWOyDMLpZt JW6AUcs5ZAamnzxIt3GclpnC9Gr4zV3wGhS3ywYIWLHP1HhR4fIHQ5etwIlwuwpjI6C0 MNlKC66xDMEfEZlhIH6OQUk7URrXP3J8DNM0MMOTG5xMOhgjfpcUQ2x9E5PAwA8LeYay qGNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qC9N/3Zo; 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 k10-v6si8156245pgr.657.2018.05.24.03.51.46; Thu, 24 May 2018 03:52:01 -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=@kernel.org header.s=default header.b=qC9N/3Zo; 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 S1032602AbeEXKuV (ORCPT + 99 others); Thu, 24 May 2018 06:50:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:37336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030470AbeEXJ53 (ORCPT ); Thu, 24 May 2018 05:57:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1A6320893; Thu, 24 May 2018 09:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155849; bh=NrNWZwzWfvfxCfHOsDvzYUC0V9Enwzr/lUr1yMRu/4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qC9N/3ZoMgM50TF8ocrFaJjY2juXrgbVGTb96q4k0SFpA8JuSmufNB6F3t5GysgI0 XjUSWoBzAVsjtzWLyezHRjWG/dDuDeThG6QxHlycl6kNU9SKzK4/EZsVfHrkYnOmCh tEJw/RFZFNVN15HYLjdh34DbAa4SvsqV2uy6aS10= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Akinobu Mita , Todor Tomov , Sakari Ailus , Sasha Levin Subject: [PATCH 4.14 139/165] media: ov5645: add missing of_node_put() in error path Date: Thu, 24 May 2018 11:39:05 +0200 Message-Id: <20180524093627.703247266@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Akinobu Mita [ Upstream commit 06fe932307d58108a11c3e603517dd2a73a57b80 ] The device node obtained with of_graph_get_next_endpoint() should be released by calling of_node_put(). But it was not released when v4l2_fwnode_endpoint_parse() failed. This change moves the of_node_put() call before the error check and fixes the issue. Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita Acked-by: Todor Tomov Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/ov5645.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1131,13 +1131,14 @@ static int ov5645_probe(struct i2c_clien ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &ov5645->ep); + + of_node_put(endpoint); + if (ret < 0) { dev_err(dev, "parsing endpoint node failed\n"); return ret; } - of_node_put(endpoint); - if (ov5645->ep.bus_type != V4L2_MBUS_CSI2) { dev_err(dev, "invalid bus type, must be CSI2\n"); return -EINVAL;