Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2924978rwb; Mon, 15 Aug 2022 14:09:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4lVH526zMaNbovDcZWs/ZjAESI2makd5+Wuuzhb4+QU0u04PFODCGYiJ6R6gnuLzF49NHQ X-Received: by 2002:a17:907:1611:b0:733:636:5686 with SMTP id hb17-20020a170907161100b0073306365686mr11646741ejc.226.1660597797937; Mon, 15 Aug 2022 14:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597797; cv=none; d=google.com; s=arc-20160816; b=0CgzlTgzau2VSwtSVyrzDB1lrdi1S+Vcp220fzL+MuACR8Ruayna1sPtW8aiIYJMYU 7jLVfXFxj+Yi7NuI47+4Uca/2yPVjCXHNRtSM3TbMHlMgBz2wXMLklfzWaZ8Qzar6Aod ZD1TiIMqpzB0un40sCAodLJU+JQRDWXXb22TWNxOEFWjx0ak6vsKi+drV8cPNUoflRRm prtC5u0wIIyHsjB3LGDYNOr7KpKihd5uMHs2T2FJy4eekALqnwjV/xgtv3XwmsbOIUUz XefIvDHf+ox6ZmuyiABazbuhqnt57ZX9pw/Skh/JngzrV0lq59YqT8bTsoz0GwOkzENQ Lc5A== 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=LYGwza/V+QSffiwmaI7tQf5Dz6Za7NojhCe3Hkoe9qE=; b=yP6NpIaD9PIwCav/yWzhscoNxK9vrGvUS7r77ASLwwJIvFletgCkuXVcVsIt+srqGd BSk/6sSFU5q2ofxutc45Ly6YmPuZO5KBq6jBYggRrnvGFi3E3eI/vzbKGuHN0vcwBZEl Mk5J6BDkbh/noE/ZE/j4zsgTkltOhDDwS36lhN+ZAbu0CCMMKNuIfZEAUzUCng86III0 5uvTlHzr9+T1RzVN0iS/7czHyG7GX0wlRaM1LE4iw0K+Ei+rBjJtK/JFdLPULkYmlhZl UyS6BCTnm1w86+OCO1ERexWyjfqYG8oFd5EajxV7kGDgm7vl99FdC1I8nhjWw1B10W9y aiRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M8kM0y3I; 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 h15-20020a17090634cf00b00730bcbd396dsi6900525ejb.406.2022.08.15.14.09.31; Mon, 15 Aug 2022 14:09:57 -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=M8kM0y3I; 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 S232252AbiHOUCB (ORCPT + 99 others); Mon, 15 Aug 2022 16:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345940AbiHOUBE (ORCPT ); Mon, 15 Aug 2022 16:01:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCCC77B1F4; Mon, 15 Aug 2022 11:53:35 -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 2D41561227; Mon, 15 Aug 2022 18:53:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A22FC433C1; Mon, 15 Aug 2022 18:53:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589607; bh=qmAwL4dfCbVkHN98smibt7siZPH+IcCOgX81JiDmpik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8kM0y3Iqp9+BKVF0lcSIR2JcS8nGqVv0goczF6VeZy4x3ZlTcARhzCpHzBBNpoq+ CTkCcSMIeDBL8c7wg6aG8DlcQAm5GzxGGQqb+fwDU1OkdJzFOt02W2cTQfygvI8roW gqITkQS//GvnD6yfZgM2tDOuLmm2Hyan2512SrQE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Martin Blumenstingl , Neil Armstrong Subject: [PATCH 5.15 772/779] drm/meson: Fix refcount leak in meson_encoder_hdmi_init Date: Mon, 15 Aug 2022 20:06:56 +0200 Message-Id: <20220815180410.395878169@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 commit 7381076809586528e2a812a709e2758916318a99 upstream. of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Add missing put_device() in error path to avoid refcount leak. Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR") Signed-off-by: Miaoqian Lin Reviewed-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220511054052.51981-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c @@ -438,8 +438,10 @@ int meson_encoder_hdmi_init(struct meson cec_fill_conn_info_from_drm(&conn_info, meson_encoder_hdmi->connector); notifier = cec_notifier_conn_register(&pdev->dev, NULL, &conn_info); - if (!notifier) + if (!notifier) { + put_device(&pdev->dev); return -ENOMEM; + } meson_encoder_hdmi->cec_notifier = notifier; }