From: "Zhu, Rex" <Rex.Zhu@amd.com>
To: Bradley Pankow <btpankow@gmail.com>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal
Date: Tue, 23 Feb 2016 02:21:52 +0000 [thread overview]
Message-ID: <SN1PR12MB06722832D8B95CDE507169C9FBA40@SN1PR12MB0672.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1456189907-6910-1-git-send-email-btpankow@gmail.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Best Regards
Rex Zhu
-----Original Message-----
From: Bradley Pankow [mailto:btpankow@gmail.com]
Sent: Tuesday, February 23, 2016 9:12 AM
To: Deucher, Alexander; Zhu, Rex; Zhou, Jammy
Cc: dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; Bradley Pankow
Subject: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal
The event_data passed from pem_fini was not cleared upon initialization.
This caused NULL checks to pass and cast_const_phw_tonga_power_state to attempt to dereference an invalid pointer. Clear the event_data in pem_init and pem_fini before calling pem_handle_event.
Signed-off-by: Bradley Pankow <btpankow@gmail.com>
---
drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
index 52a3efc..46410e3 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
@@ -31,7 +31,7 @@
static int pem_init(struct pp_eventmgr *eventmgr) {
int result = 0;
- struct pem_event_data event_data;
+ struct pem_event_data event_data = { {0} };
/* Initialize PowerPlay feature info */
pem_init_feature_info(eventmgr);
@@ -52,7 +52,7 @@ static int pem_init(struct pp_eventmgr *eventmgr)
static void pem_fini(struct pp_eventmgr *eventmgr) {
- struct pem_event_data event_data;
+ struct pem_event_data event_data = { {0} };
pem_uninit_featureInfo(eventmgr);
pem_unregister_interrupts(eventmgr);
--
2.7.1
next prev parent reply other threads:[~2016-02-23 2:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 1:11 [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal Bradley Pankow
2016-02-23 2:21 ` Zhu, Rex [this message]
2016-02-23 17:50 ` 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=SN1PR12MB06722832D8B95CDE507169C9FBA40@SN1PR12MB0672.namprd12.prod.outlook.com \
--to=rex.zhu@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=btpankow@gmail.com \
--cc=dri-devel@lists.freedesktop.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).