[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bd577fa9-d487-457b-8c27-bbbfd338fcea@amd.com>
Date: Tue, 14 Nov 2023 09:21:11 -0500
From: Hamza Mahfooz <hamza.mahfooz@....com>
To: José Pekkarinen <jose.pekkarinen@...hound.fi>,
harry.wentland@....com, sunpeng.li@....com,
Rodrigo.Siqueira@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com,
skhan@...uxfoundation.org
Cc: airlied@...il.com, daniel@...ll.ch, Wayne.Lin@....com,
qingqing.zhuo@....com, lyude@...hat.com, aurabindo.pillai@....com,
sungjoon.kim@....com, srinivasan.shanmugam@....com,
mikita.lipski@....com, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH] drm/amd/display: fix NULL dereference
On 11/14/23 01:36, José Pekkarinen wrote:
> The following patch will fix a minor issue where a debug message is
> referencing an struct that has just being checked whether is null or
> not. This has been noticed by using coccinelle, in the following output:
>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c:540:25-29: ERROR: aconnector is NULL but dereferenced.
>
> Fixes: 5d72e247e58c9 ("drm/amd/display: switch DC over to the new DRM logging macros")
> Signed-off-by: José Pekkarinen <jose.pekkarinen@...hound.fi>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index ed784cf27d39..7048dab5e356 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -537,8 +537,7 @@ bool dm_helpers_dp_read_dpcd(
> struct amdgpu_dm_connector *aconnector = link->priv;
>
> if (!aconnector) {
> - drm_dbg_dp(aconnector->base.dev,
> - "Failed to find connector for link!\n");
> + DRM_ERROR("Failed to find connector for link!");
I would prefer a patch that drops this error message entirely since
it's not particularly useful. As, it's only possible before hw init
(and at that point it's expected).
> return false;
> }
>
--
Hamza
Powered by blists - more mailing lists