[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c17625f5-515e-3c8a-29b8-0bef9f125dc4@linaro.org>
Date: Tue, 18 Jul 2023 11:15:56 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: sunran001@...suo.com, robdclark@...il.com,
quic_abhinavk@...cinc.com, airlied@...il.com, daniel@...ll.ch
Cc: linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm/dsi: add missing put_device()
On 18/07/2023 11:13, sunran001@...suo.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@...suo.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
Powered by blists - more mailing lists