From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
To: "Colin King" <colin.king@canonical.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Zhou" <David1.Zhou@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"John Clements" <john.clements@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amdgpu: ensure device_list is initialised before calling list_add_tail
Date: Sat, 11 Apr 2020 00:42:54 -0400 [thread overview]
Message-ID: <9d80a5a0-ee0d-1903-2631-6fa573e4453a@amd.com> (raw)
In-Reply-To: <20200410225757.97473-1-colin.king@canonical.com>
On 4/10/20 6:57 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the call to list_add_tail will access an the uninitalised
> device_list.prev. Fix this by ensuring device_list is initialized before
> adding items to it.
>
> Addresses-Coverity: ("Uninitialized pointer read")
That weird, I see that his is already initialized unconditionally here -
https://elixir.bootlin.com/linux/v5.6.3/source/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L4022
Andrey
> Fixes: b3dbd6d3ec49 ("drm/amdgpu: resolve mGPU RAS query instability")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index b0aa4e1ed4df..caa4969bd46f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1447,6 +1447,7 @@ static void amdgpu_ras_do_recovery(struct work_struct *work)
> if (hive && adev->gmc.xgmi.num_physical_nodes > 1) {
> device_list_handle = &hive->device_list;
> } else {
> + INIT_LIST_HEAD(&device_list);
> list_add_tail(&adev->gmc.xgmi.head, &device_list);
> device_list_handle = &device_list;
> }
prev parent reply other threads:[~2020-04-11 4:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 22:57 [PATCH] drm/amdgpu: ensure device_list is initialised before calling list_add_tail Colin King
2020-04-11 4:42 ` Andrey Grodzovsky [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=9d80a5a0-ee0d-1903-2631-6fa573e4453a@amd.com \
--to=andrey.grodzovsky@amd.com \
--cc=David1.Zhou@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=colin.king@canonical.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=john.clements@amd.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 NNTP newsgroup(s).