From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alex Deucher <alexander.deucher@amd.com>, Monk Liu <Monk.Liu@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>,
"Emily Deng" <Emily.Deng@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Marek Olšák" <marek.olsak@amd.com>,
"Tao Zhou" <tao.zhou1@amd.com>,
kernel-janitors@vger.kernel.org, amd-gfx@lists.freedesktop.org,
"Le Ma" <le.ma@amd.com>, "Huang Rui" <ray.huang@amd.com>,
dri-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"James Zhu" <James.Zhu@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Dennis Li" <Dennis.Li@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>
Subject: [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
Date: Fri, 20 Mar 2020 16:24:11 +0300 [thread overview]
Message-ID: <20200320132411.GD95012@mwanda> (raw)
The "shadow" variable was never set to false.
There is a quirk in current versions of GCC where it will sometimes set
it to false and not warn about the uninitiliazed variable. That means
that this bug wouldn't have been discovered in normal testing.
Fixes: 2e0cc4d48b91 ("drm/amdgpu: revise RLCG access path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7bc2486167e7..affbff76758c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -735,7 +735,7 @@ void gfx_v9_0_rlcg_wreg(struct amdgpu_device *adev, u32 offset, u32 v)
static void *spare_int;
static uint32_t grbm_cntl;
static uint32_t grbm_idx;
- bool shadow;
+ bool shadow = false;
scratch_reg0 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0)*4;
scratch_reg1 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG1)*4;
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alex Deucher <alexander.deucher@amd.com>, Monk Liu <Monk.Liu@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>,
"Emily Deng" <Emily.Deng@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Marek Olšák" <marek.olsak@amd.com>,
"Tao Zhou" <tao.zhou1@amd.com>,
kernel-janitors@vger.kernel.org, amd-gfx@lists.freedesktop.org,
"Le Ma" <le.ma@amd.com>, "Huang Rui" <ray.huang@amd.com>,
dri-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"James Zhu" <James.Zhu@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Dennis Li" <Dennis.Li@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>
Subject: [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
Date: Fri, 20 Mar 2020 13:24:11 +0000 [thread overview]
Message-ID: <20200320132411.GD95012@mwanda> (raw)
The "shadow" variable was never set to false.
There is a quirk in current versions of GCC where it will sometimes set
it to false and not warn about the uninitiliazed variable. That means
that this bug wouldn't have been discovered in normal testing.
Fixes: 2e0cc4d48b91 ("drm/amdgpu: revise RLCG access path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7bc2486167e7..affbff76758c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -735,7 +735,7 @@ void gfx_v9_0_rlcg_wreg(struct amdgpu_device *adev, u32 offset, u32 v)
static void *spare_int;
static uint32_t grbm_cntl;
static uint32_t grbm_idx;
- bool shadow;
+ bool shadow = false;
scratch_reg0 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0)*4;
scratch_reg1 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG1)*4;
--
2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alex Deucher <alexander.deucher@amd.com>, Monk Liu <Monk.Liu@amd.com>
Cc: "Emily Deng" <Emily.Deng@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Marek Olšák" <marek.olsak@amd.com>,
"Tao Zhou" <tao.zhou1@amd.com>,
kernel-janitors@vger.kernel.org, amd-gfx@lists.freedesktop.org,
"Le Ma" <le.ma@amd.com>, "Huang Rui" <ray.huang@amd.com>,
dri-devel@lists.freedesktop.org,
"Zhou pengju" <pengju.zhou@amd.com>,
"James Zhu" <James.Zhu@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Dennis Li" <Dennis.Li@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>
Subject: [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
Date: Fri, 20 Mar 2020 16:24:11 +0300 [thread overview]
Message-ID: <20200320132411.GD95012@mwanda> (raw)
The "shadow" variable was never set to false.
There is a quirk in current versions of GCC where it will sometimes set
it to false and not warn about the uninitiliazed variable. That means
that this bug wouldn't have been discovered in normal testing.
Fixes: 2e0cc4d48b91 ("drm/amdgpu: revise RLCG access path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7bc2486167e7..affbff76758c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -735,7 +735,7 @@ void gfx_v9_0_rlcg_wreg(struct amdgpu_device *adev, u32 offset, u32 v)
static void *spare_int;
static uint32_t grbm_cntl;
static uint32_t grbm_idx;
- bool shadow;
+ bool shadow = false;
scratch_reg0 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0)*4;
scratch_reg1 = adev->rmmio + (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG1)*4;
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2020-03-20 13:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 13:24 Dan Carpenter [this message]
2020-03-20 13:24 ` [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg() Dan Carpenter
2020-03-20 13:24 ` Dan Carpenter
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=20200320132411.GD95012@mwanda \
--to=dan.carpenter@oracle.com \
--cc=David1.Zhou@amd.com \
--cc=Dennis.Li@amd.com \
--cc=Emily.Deng@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=James.Zhu@amd.com \
--cc=Monk.Liu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=le.ma@amd.com \
--cc=marek.olsak@amd.com \
--cc=ray.huang@amd.com \
--cc=tao.zhou1@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.