aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch
new file mode 100644
index 00000000..485f7687
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1606-drm-amdgpu-Fix-ras-debugfs-data-parse.patch
@@ -0,0 +1,30 @@
+From 1d7a22f3f629504918dde12ca0b2cc605ef28256 Mon Sep 17 00:00:00 2001
+From: xinhui pan <xinhui.pan@amd.com>
+Date: Mon, 11 Mar 2019 18:10:57 +0800
+Subject: [PATCH 1606/2940] drm/amdgpu: Fix ras debugfs data parse
+
+Unzero char is accepted by sscanf, so when data is structure but
+unexpectedly return error invalid;
+
+Signed-off-by: xinhui pan <xinhui.pan@amd.com>
+Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+index 74a65a61fd23..1acaa8473629 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+@@ -241,7 +241,7 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
+ op = 1;
+ else if (sscanf(str, "inject %32s %8s", block_name, err) == 2)
+ op = 2;
+- else if (sscanf(str, "%32s", block_name) == 1)
++ else if (str[0] && str[1] && str[2] && str[3])
+ /* ascii string, but commands are not matched. */
+ return -EINVAL;
+
+--
+2.17.1
+