Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp619265iog; Mon, 13 Jun 2022 09:16:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9i6sIXTWqLBbcXyfgfua6zm+oB+jSLbpKc6XFCE0XqLEKzQ6U6NsucW+qAkRjC97VujNc X-Received: by 2002:a17:90b:350b:b0:1e8:5177:fe7d with SMTP id ls11-20020a17090b350b00b001e85177fe7dmr16916620pjb.142.1655136968604; Mon, 13 Jun 2022 09:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655136968; cv=none; d=google.com; s=arc-20160816; b=rY1DViUg/UWMUkT5xElZhCQnM9Zy9JKUWDaFHDbDEG4RyF+N4PZSkJ+pyqIaVExDpj uCGkeuOfn98A6LzsdYIDpJ7HoxHehOzZjf3j/NqeYgAktZvI60xkFffYc/k38EDxGaHJ Tyq7epSZAGDMfZO/3dPDoIGROGFEPpZPlZWHHRDOUyO/9aNUu1l8QH1RlgEBb5t+YpzO 9StVqDyugWlodmGsF9X2AdNzBNquMs33fjr3uLInneP+Bhvt/+5zfPITEjS6OkVy+WTd yTwEBVXmOgTp5LDa4Z+aswZ694sawGpUQMLmqplm/qXJuGIKyJrLGxCSx5RjBxqK/Ue3 j5kw== 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=JMfXzhRc9Dkx7Julwl0WdTcL2O7qkb6Aw8qUGrx4N+k=; b=tgwVrbYn7ic+OoTvzjTmgvlpGC797VTU6vyV6cgVT/xvgSK7vXzM6E/yQTGbL0jgsB 4RxJDrdcfte4hEGWLFCFBPWbAMuVbY51WOuFt2gEJtKuer61jetiMnAK4TzlvDE/A1r7 C6fLx45+Me+aMYXr37juW5ZcNB1WUh3Nh9Iu/TF/29aw/P8masNM4hsgKdEDTmtciVnQ 2M+9CKG+HrGIqgJMe9V9HTvkli0nllaXW3XFE3ifikvHj7rrr3RdMOi05pW1D0E04nDI pUkDdcwZHrFIoYflQ93t85ZPbtYRy0zlbmYVIPGfigdngpfb0zpYGPQAOuKYWzsXtxi6 PVuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LWw/ohjA"; 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 c1-20020a056a00248100b0050d429bb67esi400161pfv.82.2022.06.13.09.15.54; Mon, 13 Jun 2022 09:16:08 -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="LWw/ohjA"; 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 S1353813AbiFMLZP (ORCPT + 99 others); Mon, 13 Jun 2022 07:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352837AbiFMLS6 (ORCPT ); Mon, 13 Jun 2022 07:18:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5D5396B4; Mon, 13 Jun 2022 03:40:42 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7215160F9A; Mon, 13 Jun 2022 10:40:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86BAFC34114; Mon, 13 Jun 2022 10:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116840; bh=keyuwmO/petYx4R5izKmLeGjxkBkMwZ3pHtMJmZpm/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LWw/ohjAh2t84r53zqYNjEs4QJC343sUlRvvvXDv3YyI+8lylYi17cAN3odIJLHP2 XBRCLjr9Ftc9LCd0jIDz9SJj+wuvi/fPdS8p9cAz7wK7niyrUTG51yHFviqO4EWoMd oSbGIe4ZssTWoEmmbbM1zl5wRLLUqgkyvQlWttuo= 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 5.4 204/411] video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup Date: Mon, 13 Jun 2022 12:07:57 +0200 Message-Id: <20220613094934.776104280@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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 7de43be6ef2c..3b7a7c74bf0a 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -774,12 +774,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