dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dsi: add missing put_device()
       [not found] <20230718083149.17178-1-xujianghui@cdjrlc.com>
@ 2023-07-18  8:33 ` sunran001
  2023-07-18  8:35   ` Dmitry Baryshkov
  0 siblings, 1 reply; 4+ messages in thread
From: sunran001 @ 2023-07-18  8:33 UTC (permalink / raw)
  To: robdclark, quic_abhinavk, dmitry.baryshkov, airlied, daniel
  Cc: linux-arm-msm, freedreno, linux-kernel, dri-devel

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Detected by coccinelle with the following ERROR:
./drivers/gpu/drm/msm/dsi/dsi.c:50:1-7: ERROR: missing put_device; call
of_find_device_by_node on line 32, but without a corresponding object
release within this function.

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c 
b/drivers/gpu/drm/msm/dsi/dsi.c
index 81461e8852a7..5e3cc287f0d3 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -46,7 +46,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
          DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", 
__func__);
          return -EPROBE_DEFER;
      }
-    put_device(&pdev->dev);
+    put_device(&phy_pdev->dev);
      return 0;
  }

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

* Re: [PATCH] drm/msm/dsi: add missing put_device()
  2023-07-18  8:33 ` [PATCH] drm/msm/dsi: add missing put_device() sunran001
@ 2023-07-18  8:35   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2023-07-18  8:35 UTC (permalink / raw)
  To: sunran001, robdclark, quic_abhinavk, airlied, daniel
  Cc: linux-arm-msm, freedreno, linux-kernel, dri-devel

On 18/07/2023 11:33, sunran001@208suo.com wrote:
> The of_find_device_by_node() takes a reference to the underlying device
> structure, we should release that reference.
> 
> Detected by coccinelle with the following ERROR:
> ./drivers/gpu/drm/msm/dsi/dsi.c:50:1-7: ERROR: missing put_device; call
> of_find_device_by_node on line 32, but without a corresponding object
> release within this function.

Still NAK, the device should not be put. It is handled in dsi_destroy(), 
as I wrote in the previous email. Please stop.

Note, your patch lacks versioning and changelog. Please care to read 
Documentation/process/submitting-patches.rst before sending your changes.

> 
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
>   drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 81461e8852a7..5e3cc287f0d3 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -46,7 +46,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
>           DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", 
> __func__);
>           return -EPROBE_DEFER;
>       }
> -    put_device(&pdev->dev);
> +    put_device(&phy_pdev->dev);
>       return 0;
>   }

-- 
With best wishes
Dmitry


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

* Re: [PATCH] drm/msm/dsi: add missing put_device()
  2023-07-18  8:13 ` sunran001
@ 2023-07-18  8:15   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2023-07-18  8:15 UTC (permalink / raw)
  To: sunran001, robdclark, quic_abhinavk, airlied, daniel
  Cc: linux-arm-msm, freedreno, linux-kernel, dri-devel

On 18/07/2023 11:13, sunran001@208suo.com wrote:
> The of_find_device_by_node() takes a reference to the underlying device
> structure, we should release that reference.
> 
> Detected by coccinelle with the following ERROR:
> ./drivers/gpu/drm/msm/dsi/dsi.c:50:1-7: ERROR: missing put_device; call
> of_find_device_by_node on line 32, but without a corresponding object
> release within this function.
> 
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
>   drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index baab79ab6e74..81461e8852a7 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -46,7 +46,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
>           DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", 
> __func__);
>           return -EPROBE_DEFER;
>       }
> -
> +    put_device(&pdev->dev);

NAK. First, you are putting pdev instead of phy_pdev. Next, the 
reference to the phy dev is correctly stored and then put in 
dsi_destroy(). Please do not make blind patches when reviewing static 
analyser warnings.

>       return 0;
>   }

-- 
With best wishes
Dmitry


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

* [PATCH] drm/msm/dsi: add missing put_device()
       [not found] <20230718081139.16918-1-xujianghui@cdjrlc.com>
@ 2023-07-18  8:13 ` sunran001
  2023-07-18  8:15   ` Dmitry Baryshkov
  0 siblings, 1 reply; 4+ messages in thread
From: sunran001 @ 2023-07-18  8:13 UTC (permalink / raw)
  To: robdclark, quic_abhinavk, dmitry.baryshkov, airlied, daniel
  Cc: linux-arm-msm, freedreno, linux-kernel, dri-devel

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Detected by coccinelle with the following ERROR:
./drivers/gpu/drm/msm/dsi/dsi.c:50:1-7: ERROR: missing put_device; call
of_find_device_by_node on line 32, but without a corresponding object
release within this function.

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c 
b/drivers/gpu/drm/msm/dsi/dsi.c
index baab79ab6e74..81461e8852a7 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -46,7 +46,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
          DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", 
__func__);
          return -EPROBE_DEFER;
      }
-
+    put_device(&pdev->dev);
      return 0;
  }

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

end of thread, other threads:[~2023-07-18  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230718083149.17178-1-xujianghui@cdjrlc.com>
2023-07-18  8:33 ` [PATCH] drm/msm/dsi: add missing put_device() sunran001
2023-07-18  8:35   ` Dmitry Baryshkov
     [not found] <20230718081139.16918-1-xujianghui@cdjrlc.com>
2023-07-18  8:13 ` sunran001
2023-07-18  8:15   ` Dmitry Baryshkov

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).