Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp632012iog; Mon, 13 Jun 2022 09:31:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9/7X9ctaAv9tqBwoYK5IwAwoqGOD/ddyxK5dknZZsOTsU4sJK51f/CjcWjhzw4kmiw75g X-Received: by 2002:a17:90b:1d08:b0:1e4:dad9:64e5 with SMTP id on8-20020a17090b1d0800b001e4dad964e5mr16604577pjb.200.1655137880226; Mon, 13 Jun 2022 09:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137880; cv=none; d=google.com; s=arc-20160816; b=NwHfmWnCcsE8zaWDHVfXHhM4njXMXTejphvY4ELYREHwy2tLIX6v3O2t8WWTbLgOwz iK6xBa6Mg7zG3s4GM0rXf3AadluwAG1eB3vUOMrUDFmSBy4wtcqF4erL8EYSJ0M3PgNP /LyWPP5hcoW6U2PLTlUn+WJUg8ZoR0LHPfCQ9gdcoslP13xFB0imjkK5YAYzAZ8xbsv0 BxLHZyFSXGJuNDvvVl+QWsGDjrPYxBBh0m4jua8+cKqTG8HFzuIMmCfAyrWmyEpXa1I1 x2qYoNvICTEoy2Onw0yPYWctvE5KdKFtz8C2xwhQxVKqTrH14F1n5HtVr97j014oOsBh Txvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/4wscbVDweiWrmRCAveVX+Vj+hSvEkOZspBjv9iP3Bg=; b=dgVoJIXDIwgEaVlr3ExyJ627Btjo1Kc+WdZVQHp29RkioZbhdFjidPZJSeGCQ2su5+ kaUKPw09arEg4p10bpmL5YXITrb73xP2UB3tfk5qlZ9xnJSDv3HWG9vrVc7ZuIx/UVPw Z6yHEDJ6knljaaCOtXnHv5ROxerV2i+4CgBRXulagoC2OecRHSmK14oOcuCFVqteDNOL jLkKaDM4bKH6pFlsvdaLoptDORLGEYBsR6T8nPqIPre8hgzIxyvyh+WwsDH4quZVxm+r Zfz76WFSo6otrO1S03MU03iG3CxqTy+P6dHV3suS2aVnks3FJIalsA6L9xIeTNBrJuYP e5Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=phv3RFYh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 186-20020a6206c3000000b005181059a510si8757444pfg.314.2022.06.13.09.31.07; Mon, 13 Jun 2022 09:31:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=phv3RFYh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243209AbiFMKWK (ORCPT + 99 others); Mon, 13 Jun 2022 06:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242947AbiFMKUm (ORCPT ); Mon, 13 Jun 2022 06:20:42 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75C0E210; Mon, 13 Jun 2022 03:17:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C1A84CE1166; Mon, 13 Jun 2022 10:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3125C34114; Mon, 13 Jun 2022 10:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115437; bh=SOaqGZShnNaHr8H3G8tENc/Lx6XCp24eDgVvTmgJi/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phv3RFYhBAoUyxc4QZfDhlOAQWUhyFhXrsluu1mES1I+OBrDnUhhQGzq79Rj+ibLD TbmiavcEaTypIX3ZaSzf/VOFnyak7ARWErB5AM1L3BXYSBeodmt5aOXq1bQMOa6w6T teO/JkK/8zNtupMQhC6Oh7OHMG7on/nv3DDz/CIA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Helge Deller , Sasha Levin Subject: [PATCH 4.9 073/167] video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup Date: Mon, 13 Jun 2022 12:09:07 +0200 Message-Id: <20220613094858.000197973@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit b23789a59fa6f00e98a319291819f91fbba0deb8 ] of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: d10715be03bd ("video: ARM CLCD: Add DT support") Signed-off-by: Miaoqian Lin Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/amba-clcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 89880b70cc28..ca3707e59633 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -849,12 +849,15 @@ static int clcdfb_of_vram_setup(struct clcd_fb *fb) return -ENODEV; fb->fb.screen_base = of_iomap(memory, 0); - if (!fb->fb.screen_base) + if (!fb->fb.screen_base) { + of_node_put(memory); return -ENOMEM; + } fb->fb.fix.smem_start = of_translate_address(memory, of_get_address(memory, 0, &size, NULL)); fb->fb.fix.smem_len = size; + of_node_put(memory); return 0; } -- 2.35.1