From: Mikita Lipski <mlipski@amd.com>
To: Colin King <colin.king@canonical.com>,
"Wentland, Harry" <Harry.Wentland@amd.com>,
"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Koenig, Christian" <Christian.Koenig@amd.com>,
"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Lyude Paul <lyude@redhat.com>,
"Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
"Lipski, Mikita" <Mikita.Lipski@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Cc: "kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] drm/amd/display: fix dereference of pointer aconnector when it is null
Date: Fri, 8 Nov 2019 14:42:03 +0000 [thread overview]
Message-ID: <7155ecfc-1aff-002d-9cc6-e097525e7cb6@amd.com> (raw)
In-Reply-To: <20191108143814.118856-1-colin.king@canonical.com>
Thanks!
Reviewed-by: Mikita Lipski <mikita.lipski@amd.com>
On 08.11.2019 9:38, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently pointer aconnector is being dereferenced by the call to
> to_dm_connector_state before it is being null checked, this could
> lead to a null pointer dereference. Fix this by checking that
> aconnector is null before dereferencing it.
>
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 5133c6241d9c ("drm/amd/display: Add MST atomic routines")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 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 e3cda6984d28..72e677796a48 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
> @@ -193,12 +193,11 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
> * that blocks before commit guaranteeing that the state
> * is not gonna be swapped while still in use in commit tail */
>
> - dm_conn_state = to_dm_connector_state(aconnector->base.state);
> -
> -
> if (!aconnector || !aconnector->mst_port)
> return false;
>
> + dm_conn_state = to_dm_connector_state(aconnector->base.state);
> +
> mst_mgr = &aconnector->mst_port->mst_mgr;
>
> if (!mst_mgr->mst_state)
>
--
Thanks,
Mikita Lipski
mikita.lipski@amd.com
next prev parent reply other threads:[~2019-11-08 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 14:38 [PATCH][next] drm/amd/display: fix dereference of pointer aconnector when it is null Colin King
2019-11-08 14:42 ` Mikita Lipski [this message]
2019-11-08 16:33 ` Alex Deucher
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=7155ecfc-1aff-002d-9cc6-e097525e7cb6@amd.com \
--to=mlipski@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=David1.Zhou@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=Mikita.Lipski@amd.com \
--cc=Nicholas.Kazlauskas@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=airlied@linux.ie \
--cc=amd-gfx@lists.freedesktop.org \
--cc=colin.king@canonical.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.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