Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2930485rwb; Mon, 15 Aug 2022 14:16:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5akA8NADHfXBxhg+3X6YZFRsaWMt8pfJf9qWRhWQX+JlBpe0vps16vk3iLyUoidVd1sITH X-Received: by 2002:a05:6402:520f:b0:43e:5cf1:d1 with SMTP id s15-20020a056402520f00b0043e5cf100d1mr16239605edd.22.1660598182188; Mon, 15 Aug 2022 14:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598182; cv=none; d=google.com; s=arc-20160816; b=h5yeoz1KdDbv1w++jSJBrERdzYOunj0xmbZBqISc8Qyp5HceOrWv07DF/Xc3eV4sZc phOyC2LJEAGGQzRd8ssPd1txJf2D0vvApUId6aNTGbiPUyi9tGD0KegY3BYg67HWWXsS tePxheOyU2L1wS/pQbXwy4Itr9tCuXMILyC4jwgOu7H33khuWYzpwmyV1VXcci9Y9sct ERlEEWQPEp8iv+wmzRCEcnpG0HTpx8VnC7LKYfww5AQuOJ7JZvOHNPoMF44u11C/CNp3 SZ7kJf3D/Zo6wIZheYIkyP4LsRLW0MoK1asrvnKRPiiYrupKFvFDR9o9KQAQ1rruBSwo s/NQ== 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=XdzRxLadKo5o7nojXAaI0m1ow84CmU8cnASEdITgsMw=; b=mKi2Ta5guTmmHCQKYlhEWIrQixGT4w6n7oX7erbjHTdYwsdjazdEkG1pb0YKDc52y0 5Rn5dh9WPwwx8+oKdb0Cv130slOxq8v/q0fS+RRzzgtTe/kREEjBy9jOG2OluSqRg8bz wPzX0a1NflxiBf5DxcJF4IaqpixHoKDCCzkQzWHVzc+LJuBoKC2KYWlvuM6sXFyc4auK SJn02OSOxSHpE5Wc7ijm5uxs76bXEB4+6G803/HyTBuMeTiMkfY/jinT/ti2zVUF2W/N ZqSrw5qkvyKt+u7cIyW6o78+kClPLGatcR0b8dMtvQW9a3H53VSRisd5+7E82JJE9/8L uGKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ntO2nN81; 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 qw38-20020a1709066a2600b0073046c15d8csi8739454ejc.610.2022.08.15.14.15.54; Mon, 15 Aug 2022 14:16:22 -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=ntO2nN81; 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 S243491AbiHOVE2 (ORCPT + 99 others); Mon, 15 Aug 2022 17:04:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346677AbiHOUzb (ORCPT ); Mon, 15 Aug 2022 16:55:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 858483B94C; Mon, 15 Aug 2022 12:11:12 -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 2D73460BB5; Mon, 15 Aug 2022 19:11:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1868FC433C1; Mon, 15 Aug 2022 19:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590669; bh=hP/9KZye9mvWkD+qnzNh7Mn9ujOi/BfJgmHbNS6xy7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ntO2nN81cF3GIceOa6Qc/Bs2VhqrJ+37ThCcVIOl6Md60UfAqth2Rj9YbLDI4MU/4 wMJ/dUyH0kxyI3NFnT7OYsazHM+VQ00X9mA1VsIoBS3RK3p92ftvKEEzUPq1z/H+UQ jxP+XOFJ/ezfAvbbVRsSs0txfIfiZee1iDuUcm1w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Martin Blumenstingl , Neil Armstrong , Sasha Levin Subject: [PATCH 5.18 0302/1095] drm/meson: Fix refcount leak in meson_encoder_hdmi_init Date: Mon, 15 Aug 2022 19:55:01 +0200 Message-Id: <20220815180442.263636035@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 [ Upstream commit 7381076809586528e2a812a709e2758916318a99 ] 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: Sasha Levin --- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c index 5e306de6f485..de87f02cd388 100644 --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c @@ -435,8 +435,10 @@ int meson_encoder_hdmi_init(struct meson_drm *priv) 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; } -- 2.35.1