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,
srinivasan.shanmugam@amd.com, aurabindo.pillai@amd.com,
sungjoon.kim@amd.com, wenjing.liu@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 v2] drm/amd/display: fix NULL dereference
Date: Tue, 14 Nov 2023 16:01:14 -0500 [thread overview]
Message-ID: <689f3862-09d5-448d-b418-fd52d7288106@amd.com> (raw)
In-Reply-To: <20231114152751.30167-1-jose.pekkarinen@foxhound.fi>
On 11/14/23 10:27, 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")
You only need the first 12 characters of the hash here. I have fixed it
for you and applied the patch in this case. But, in the future please
test your patches against `./scripts/checkpatch.pl` before submitting
them.
> Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi>
> ---
> [v1 -> v2]: Remove the debugging message, requested by Hamza
>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +----
> 1 file changed, 1 insertion(+), 4 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..c7a29bb737e2 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
> @@ -536,11 +536,8 @@ 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");
> + if (!aconnector)
> return false;
> - }
>
> return drm_dp_dpcd_read(&aconnector->dm_dp_aux.aux, address, data,
> size) == size;
--
Hamza
next prev parent reply other threads:[~2023-11-14 21:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 15:27 José Pekkarinen
2023-11-14 21:01 ` Hamza Mahfooz [this message]
2023-11-15 5:52 ` José Pekkarinen
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=689f3862-09d5-448d-b418-fd52d7288106@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 \
--cc=wenjing.liu@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
all inboxes | Powered by JetHome®