projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5caf466
)
drm/amdgpu: Fix ras debugfs data parse
author
xinhui pan
<xinhui.pan@amd.com>
Mon, 11 Mar 2019 10:10:57 +0000
(18:10 +0800)
committer
Alex Deucher
<alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:36:51 +0000
(15:36 -0500)
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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index
74a65a6
..
1acaa84
100644
(file)
--- 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 (s
scanf(str, "%32s", block_name) == 1
)
+ else if (s
tr[0] && str[1] && str[2] && str[3]
)
/* ascii string, but commands are not matched. */
return -EINVAL;