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:
967de2a
)
drm/amd/amdgpu/amdgpu_ttm: Handle return NULL error from ioremap_nocache
author
Arvind Yadav
<
[email protected]
>
Tue, 24 Jan 2017 09:25:33 +0000
(14:55 +0530)
committer
Alex Deucher
<
[email protected]
>
Fri, 27 Jan 2017 17:20:38 +0000
(12:20 -0500)
Here, If ioremap_nocache will fail. It will return NULL.
Kernel can run into a NULL-pointer dereference.
This error check will avoid NULL pointer dereference.
Reviewed-by: Christian König <
[email protected]
>
Signed-off-by: Arvind Yadav <
[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 10e9b690676e406fd2c5fd6ef3c5400d0bf093d9..1154b0a8881d6f9d70194f971c7fb04cffc2d6a7 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@
-548,6
+548,8
@@
static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_
mem->bus.addr =
ioremap_nocache(mem->bus.base + mem->bus.offset,
mem->bus.size);
+ if (!mem->bus.addr)
+ return -ENOMEM;
/*
* Alpha: Use just the bus offset plus