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:
8ba28ac
)
drm: radeon: radeon_ttm: Handle return NULL error from ioremap_nocache
author
Arvind Yadav
<
[email protected]
>
Tue, 24 Jan 2017 09:16:16 +0000
(14:46 +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.
Signed-off-by: Arvind Yadav <
[email protected]
>
Signed-off-by: Alex Deucher <
[email protected]
>
drivers/gpu/drm/radeon/radeon_ttm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/radeon/radeon_ttm.c
b/drivers/gpu/drm/radeon/radeon_ttm.c
index 7e3eb8e80095bc2777cd3b5fe8ada3f7ac7998dc..7a10b38529702f68cc82c3557fce6fe3e13b00ec 100644
(file)
--- a/
drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/
drivers/gpu/drm/radeon/radeon_ttm.c
@@
-502,6
+502,8
@@
static int radeon_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