Linux Kernel Mentees Archive mirror
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: "José Pekkarinen" <jose.pekkarinen@foxhound.fi>,
	harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com,
	skhan@linuxfoundation.org
Cc: airlied@gmail.com, daniel@ffwll.ch, Wayne.Lin@amd.com,
	qingqing.zhuo@amd.com, lyude@redhat.com,
	aurabindo.pillai@amd.com, sungjoon.kim@amd.com,
	srinivasan.shanmugam@amd.com, mikita.lipski@amd.com,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] drm/amd/display: fix NULL dereference
Date: Tue, 14 Nov 2023 09:21:11 -0500	[thread overview]
Message-ID: <bd577fa9-d487-457b-8c27-bbbfd338fcea@amd.com> (raw)
In-Reply-To: <20231114063647.71929-1-jose.pekkarinen@foxhound.fi>

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@foxhound.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


      reply	other threads:[~2023-11-14 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  6:36 [PATCH] drm/amd/display: fix NULL dereference José Pekkarinen
2023-11-14 14:21 ` Hamza Mahfooz [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=bd577fa9-d487-457b-8c27-bbbfd338fcea@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jose.pekkarinen@foxhound.fi \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=mikita.lipski@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=skhan@linuxfoundation.org \
    --cc=srinivasan.shanmugam@amd.com \
    --cc=sungjoon.kim@amd.com \
    --cc=sunpeng.li@amd.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).