Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp741728imm; Thu, 13 Sep 2018 07:06:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbV0qoWeEWXAbl9j4StJLlmZczVSmtHpEFCHDd6RmZVrTJaIc/5EeuCRa3ILNU4kas3jyhN X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr7536070pls.265.1536847591799; Thu, 13 Sep 2018 07:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847591; cv=none; d=google.com; s=arc-20160816; b=nLT75e1I3cyEPwcBe5sZ9XsuwX5ojFhm14eaMhBxVMc8smXB7NfGflrBUNP6g8V3i3 +l0HoAdqMY0t+daqUSXJD0om9xxwga4ZfD9iS1stynUBRmwpabpuIWFmVKGw/tQgt5oH 8Maip/xek3yKcqHjAsxCAtHzvWsEK0SGFq9byBgA/o426BsCJY+p2Qk+fs9wMeY07k0y xGNdHovP7vYPkSEykm8SUalB7Dsb196n1z63Xrg0C9O59NUeAXrT+h1QfcECg2PVUa6P nVxHKLdeIIehR1BrPUdCIjx5LZIfXHONfrnh39VsYvUVp+Ki2xn/tK4q+fBXfbrFlhvD 4zag== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=4Ia7pffLk7XqukNY8z6HOe+1pMoLJrU5stbNXbYzxvQ=; b=qRzp6AO7exXHc27kwJ+0bIrkOofhGwYuv4r1L0zF/WQXYXu+vyLmKN3huUsP+mhDPb BpUwXGJS5oLtVeSGaSKJFpM+qNgTlQyfriol88pivO0y10xYXGSnIPdspJgc6ZQn9ST8 bJcHH2EhAWjzfKd8CUAqgN/dRVY3VEn4tQNFCqN26w+1vPU1U+CcAUvTNG9NHLBvxXEA YtU2sY/bSC3qIYxMNOQ9kqRY1LeQjy+NImayvjUa8Py1qbENGbe0QNJvYqVHvKsCvpgM KjKRzYrLQYV/Eij6b2DUXkLYTSE6/MGcEupgjFyVDlhdHeSBOdlhL/D4b/QD0PE3qIBN QjgA== 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 d17-v6si3863661pgp.549.2018.09.13.07.06.10; Thu, 13 Sep 2018 07:06:31 -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 S1732087AbeIMTNo (ORCPT + 99 others); Thu, 13 Sep 2018 15:13:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728556AbeIMTNo (ORCPT ); Thu, 13 Sep 2018 15:13:44 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 13D10D35; Thu, 13 Sep 2018 14:04:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Heiko Stuebner Subject: [PATCH 4.18 169/197] drm/rockchip: lvds: add missing of_node_put Date: Thu, 13 Sep 2018 15:31:58 +0200 Message-Id: <20180913131848.320705092@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julia Lawall commit ebfb081edc8afd250a6d290c37481bfb2262e7cb upstream. The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression root,e; local idexpression child; iterator name for_each_child_of_node; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Fixes: 34cc0aa25456 ("drm/rockchip: Add support for Rockchip Soc LVDS") Cc: stable@vger.kernel.org Signed-off-by: Julia Lawall Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -363,8 +363,10 @@ static int rockchip_lvds_bind(struct dev of_property_read_u32(endpoint, "reg", &endpoint_id); ret = drm_of_find_panel_or_bridge(dev->of_node, 1, endpoint_id, &lvds->panel, &lvds->bridge); - if (!ret) + if (!ret) { + of_node_put(endpoint); break; + } } if (!child_count) { DRM_DEV_ERROR(dev, "lvds port does not have any children\n");