Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp862936pxb; Tue, 1 Feb 2022 12:01:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnUOWzFrDegH9TdEiuorQ2eUTnM3waEI4iJLkefS8/qwwyx2IkrVZ6y0XMF0J8sN1Jik4h X-Received: by 2002:a17:906:31d0:: with SMTP id f16mr22203195ejf.627.1643745670033; Tue, 01 Feb 2022 12:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745670; cv=none; d=google.com; s=arc-20160816; b=z6D9g/kZ+aqQ9Qlcbz/1Bc5z5nj0wiHD+jUwsYVPYdLnut5ZXt0nWt0Mh3EzQFqG/Y OwVQo69LC/TYhTM3iGSQT9t31VwYVSsXoCWGfAOHG7sJcaw8mFbdielte6tgmvEcuGzk A6qwVOMWkwMRJfr+DA7CQtfcr7SoHpFpsMhikYuqZT3nxLeND7SD23KTQaYS8u4yJ5TI xhELbBKr7wXbiOy3LcUoXQGkMX1C5VjpR+KyCjEJyUms52quXNCV8G6qcac4EwSSBW15 lUiu+dQ4n1Hyy8FXqk7Cj6xvVgufjfs9S2z8Rx463A6nC5o+GzYk2Oe4qkTw0YgkQrRl jYZg== 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=cjubnZMf5PV5YHXC1iiaUCBMwhuSAi255iH/oA0uxrw=; b=qvDIfrqnl27QJluWsLgQf4DioUs7we3d/dQJf9lA0+b2Nvt3cn+qDWwQf8rJdbDl15 2l0FrsMC5AKHvOkO94PI+/jOq384IoQU895nXfyvXg+A3G9DMriJMWneTdjAibWmOFhY LHa8lnOhhI1ChIchHGUrHJ1nL9Tk60/NFtqdW3cQuUSURPxCNYWay+JGJ4Mkd7vAmebS YdXVqtJhiBIOgbENTUy8bt1lHZwOVnYN9dKGjomLOuXFcK6vaz7yzJq8t/pcRZg6jmoZ bykxYe98WCQudFf+1RlHLKU7AISMxxhUGJw71AwdEJ7SAG8n4eCSOhEQolvLoD83iSmW 8wlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kW1OVtmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si9609692eds.366.2022.02.01.12.00.44; Tue, 01 Feb 2022 12:01:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kW1OVtmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1376385AbiAaLMf (ORCPT + 99 others); Mon, 31 Jan 2022 06:12:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376816AbiAaLJJ (ORCPT ); Mon, 31 Jan 2022 06:09:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0D3C061A27; Mon, 31 Jan 2022 03:05:36 -0800 (PST) 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 202B260FB5; Mon, 31 Jan 2022 11:05:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03DB3C340EF; Mon, 31 Jan 2022 11:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627135; bh=rPxomZGLw2T0AeFweigh+gNKt3+WX6XmgfGi+QBKnqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kW1OVtmxFxyqkLQP6VVYZKwHTEcGd5II8dTE6mV6EJLuVhjIWEHRTsUCcLJu/0wN5 +vJtSo7E3ZX63QtoKj05Oq24nwASYc8IpnR1FIUau/KCO8nuCOvxcLUaerD0IzM3yG LiTJaxrTFbAKUvOynWZ7CSVXpTZeoJmeUqI5RYFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Baryshkov , Sasha Levin Subject: [PATCH 5.10 086/100] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy Date: Mon, 31 Jan 2022 11:56:47 +0100 Message-Id: <20220131105223.346360687@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 774fe0cd838d1b1419d41ab4ea0613c80d4ecbd7 ] The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: e00012b256d4 ("drm/msm/hdmi: Make HDMI core get its PHY") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220107085026.23831-1-linmq006@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 737453b6e5966..94f948ef279d1 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi) of_node_put(phy_node); - if (!phy_pdev || !hdmi->phy) { + if (!phy_pdev) { DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n"); return -EPROBE_DEFER; } + if (!hdmi->phy) { + DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n"); + put_device(&phy_pdev->dev); + return -EPROBE_DEFER; + } hdmi->phy_dev = get_device(&phy_pdev->dev); -- 2.34.1