From: "Christian König" <christian.koenig@amd.com>
To: Denis Arefev <arefev@swemel.ru>, Harry Wentland <harry.wentland@amd.com>
Cc: trufanov@swemel.ru, lvc-project@linuxtesting.org,
"Leo Li" <sunpeng.li@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Roman Li" <roman.li@amd.com>,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
vfh@swemel.ru, "Michel Dänzer" <mdaenzer@redhat.com>,
"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
dri-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"David Airlie" <airlied@gmail.com>
Subject: Re: [PATCH] drm/amd/display: Added pointer check
Date: Tue, 6 Dec 2022 11:59:02 +0100 [thread overview]
Message-ID: <53da1f40-c305-b70d-aaf9-8d2e23c64349@amd.com> (raw)
In-Reply-To: <20221206104757.31512-1-arefev@swemel.ru>
Am 06.12.22 um 11:47 schrieb Denis Arefev:
> Return value of a function 'dc_create_state' is
> dereferenced at amdgpu_dm.c:2027 without checking for null
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0f7749e9424d..529483997154 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1960,7 +1960,9 @@ static int dm_resume(void *handle)
> dc_release_state(dm_state->context);
> dm_state->context = dc_create_state(dm->dc);
> /* TODO: Remove dc_state->dccg, use dc->dccg directly. */
> - dc_resource_state_construct(dm->dc, dm_state->context);
> + if (dm_state->context) {
> + dc_resource_state_construct(dm->dc, dm_state->context);
> + }
Single line statements shouldn't have an {} around them.
Apart from that I think error handling when dm_state->context can't be
created would be more appropriate, but that's something our display team
needs to look at.
Regards,
Christian.
>
> /* Before powering on DC we need to re-initialize DMUB. */
> r = dm_dmub_hw_init(adev);
prev parent reply other threads:[~2022-12-06 10:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 10:47 [PATCH] drm/amd/display: Added pointer check Denis Arefev
2022-12-06 10:59 ` Christian König [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=53da1f40-c305-b70d-aaf9-8d2e23c64349@amd.com \
--to=christian.koenig@amd.com \
--cc=Jerry.Zuo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arefev@swemel.ru \
--cc=aurabindo.pillai@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mdaenzer@redhat.com \
--cc=roman.li@amd.com \
--cc=sunpeng.li@amd.com \
--cc=trufanov@swemel.ru \
--cc=vfh@swemel.ru \
/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