aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch
new file mode 100644
index 00000000..04cf0fc5
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1672-drm-amd-powerplay-Off-by-one-in-vega20_get_smu_msg_i.patch
@@ -0,0 +1,34 @@
+From da7372c943bfab9ec3c56d402b78bd8a4b158ee0 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 21 Mar 2019 12:19:57 +0300
+Subject: [PATCH 1672/2940] drm/amd/powerplay: Off by one in
+ vega20_get_smu_msg_index()
+
+The > should be >= so that we don't read one element beyond the end of
+the vega20_message_map[] array.
+
+Fixes: 78031c2c4dcd ("drm/amd/powerplay: implement smu vega20_message_map for vega20")
+Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+index 5297b23ebcd1..f5560c4243c2 100644
+--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
++++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+@@ -132,7 +132,8 @@ static int vega20_message_map[SMU_MSG_MAX_COUNT] = {
+ static int vega20_get_smu_msg_index(struct smu_context *smc, uint32_t index)
+ {
+ int val;
+- if (index > SMU_MSG_MAX_COUNT)
++
++ if (index >= SMU_MSG_MAX_COUNT)
+ return -EINVAL;
+
+ val = vega20_message_map[index];
+--
+2.17.1
+