All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
@ 2022-01-07  8:50 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-01-07  8:50 UTC (permalink / raw)
  Cc: linmq006, Rob Clark, Sean Paul, David Airlie, Daniel Vetter,
	Dmitry Baryshkov, Jyri Sarha, Abhinav Kumar, Christophe JAILLET,
	Archit Taneja, linux-arm-msm, dri-devel, freedreno, linux-kernel

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>
---
 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);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
@ 2022-01-07  8:50 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-01-07  8:50 UTC (permalink / raw)
  Cc: freedreno, linmq006, David Airlie, Jyri Sarha, Archit Taneja,
	Abhinav Kumar, linux-kernel, Christophe JAILLET, dri-devel,
	linux-arm-msm, Dmitry Baryshkov, Sean Paul

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>
---
 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);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
  2022-01-07  8:50 ` Miaoqian Lin
@ 2022-01-19 23:16   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-01-19 23:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Jyri Sarha,
	Abhinav Kumar, Christophe JAILLET, Archit Taneja, linux-arm-msm,
	dri-devel, freedreno, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
@ 2022-01-19 23:16   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-01-19 23:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: freedreno, Archit Taneja, David Airlie, Sean Paul, linux-kernel,
	Abhinav Kumar, Christophe JAILLET, dri-devel, linux-arm-msm,
	Jyri Sarha

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-19 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07  8:50 [PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy Miaoqian Lin
2022-01-07  8:50 ` Miaoqian Lin
2022-01-19 23:16 ` Dmitry Baryshkov
2022-01-19 23:16   ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.