projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7f78b6
)
drm/amd/amdgpu: Return error if initiating read out of range on vram
author
Tom St Denis
<
[email protected]
>
Tue, 23 May 2017 15:35:22 +0000
(11:35 -0400)
committer
Alex Deucher
<
[email protected]
>
Wed, 24 May 2017 22:23:55 +0000
(18:23 -0400)
If you initiate a read that is out of the VRAM address space return
ENXIO instead of 0.
Reads that begin below that point will read upto the VRAM limit as
before.
Cc:
[email protected]
Signed-off-by: Tom St Denis <
[email protected]
>
Reviewed-by: Christian König <
[email protected]
>
Signed-off-by: Alex Deucher <
[email protected]
>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index fcf617c237ef1cf56b35511e35f5f2097ab34d92..8526a02222684fc87406e65ba54e9cd12d08902b 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@
-1468,6
+1468,9
@@
static ssize_t amdgpu_ttm_vram_read(struct file *f, char __user *buf,
if (size & 0x3 || *pos & 0x3)
return -EINVAL;
+ if (*pos >= adev->mc.mc_vram_size)
+ return -ENXIO;
+
while (size) {
unsigned long flags;
uint32_t value;