projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fb0bbd
)
drm/radeon: add a check for allocation failure (v2)
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 7 Aug 2014 15:27:37 +0000
(18:27 +0300)
committer
Alex Deucher
<alexander.deucher@amd.com>
Fri, 15 Aug 2014 04:58:17 +0000
(
00:58
-0400)
We can easily return -ENOMEM here if kzalloc() fails.
v2: agd5f: drop the vm mutex
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_vm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/radeon/radeon_vm.c
b/drivers/gpu/drm/radeon/radeon_vm.c
index ccae4d9dc3deb6aefc3f131dbd9648c5ea374f1a..9c8358f6f1302d17c37294cb8f471b40ce0db30a 100644
(file)
--- a/
drivers/gpu/drm/radeon/radeon_vm.c
+++ b/
drivers/gpu/drm/radeon/radeon_vm.c
@@
-483,6
+483,10
@@
int radeon_vm_bo_set_addr(struct radeon_device *rdev,
/* add a clone of the bo_va to clear the old address */
struct radeon_bo_va *tmp;
tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
+ if (!tmp) {
+ mutex_unlock(&vm->mutex);
+ return -ENOMEM;
+ }
tmp->it.start = bo_va->it.start;
tmp->it.last = bo_va->it.last;
tmp->vm = vm;