summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-08-07 17:27:37 +0200
committerAlex Deucher <alexander.deucher@amd.com>2014-08-15 06:58:17 +0200
commit68b1ea30e4b64c6c5a1ed7c1970062d61c1a892c (patch)
tree71a6ee059681061434df34f99633e46d43b6275c /drivers
parentdrm/radeon: use pfp for all vm_flush related updates (diff)
downloadlinux-68b1ea30e4b64c6c5a1ed7c1970062d61c1a892c.tar.xz
linux-68b1ea30e4b64c6c5a1ed7c1970062d61c1a892c.zip
drm/radeon: add a check for allocation failure (v2)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon_vm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index ccae4d9dc3de..9c8358f6f130 100644
--- 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;