From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Jyri Sarha <jyri.sarha@iki.fi>,
Abhinav Kumar <abhinavk@codeaurora.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Archit Taneja <architt@codeaurora.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
Date: Thu, 20 Jan 2022 02:16:35 +0300 [thread overview]
Message-ID: <8042df9c-5dba-a857-e62f-3ea66c2cd218@linaro.org> (raw)
In-Reply-To: <20220107085026.23831-1-linmq006@gmail.com>
On 07/01/2022 11:50, Miaoqian Lin wrote:
> 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 <linmq006@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> 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 75b64e6ae035..a439794a32e8 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -95,10 +95,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);
>
--
With best wishes
Dmitry
prev parent reply other threads:[~2022-01-19 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 8:50 [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy Miaoqian Lin
2022-01-19 23:16 ` Dmitry Baryshkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8042df9c-5dba-a857-e62f-3ea66c2cd218@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=abhinavk@codeaurora.org \
--cc=airlied@linux.ie \
--cc=architt@codeaurora.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jyri.sarha@iki.fi \
--cc=linmq006@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).