aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch')
-rw-r--r--common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch b/common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch
new file mode 100644
index 00000000..92fff479
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0207-amdgpu-fix-NULL-pointer-dereference-at-tonga_check_s.patch
@@ -0,0 +1,43 @@
+From 31a8dc088815792e81afc89eed55f48567bde4e9 Mon Sep 17 00:00:00 2001
+From: Bradley Pankow <btpankow@gmail.com>
+Date: Mon, 22 Feb 2016 20:11:47 -0500
+Subject: [PATCH 0207/1110] 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.
+
+Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
+Signed-off-by: Bradley Pankow <btpankow@gmail.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.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.4
+