[PATCH] drm/amdgpu: Fix size check
Pan, Xinhui
Xinhui.Pan at amd.com
Tue Mar 19 03:53:35 UTC 2019
data is a pointer. So add * back.
Fixes: ad258a5c ("drm/amdgpu: add human readable debugfs control support")
Signed-off-by: xinhui pan <xinhui.pan at 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 a71668b8a7d0..85a9398835f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -270,7 +270,7 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
data->inject.value = value;
}
} else {
- if (size < sizeof(data))
+ if (size < sizeof(*data))
return -EINVAL;
if (copy_from_user(data, buf, sizeof(*data)))
--
2.17.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190319/58ed90f1/attachment.html>
More information about the amd-gfx
mailing list