]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/radeon: fix error handling in radeon_vm_bo_set_addr
authorChristian König <christian.koenig@amd.com>
Tue, 22 Jul 2014 09:30:43 +0000 (11:30 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Jul 2014 16:21:58 +0000 (12:21 -0400)
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_vm.c

index fa41e0d7d17d191ef8b54e289311456e79006565..725d3669014f8ef2bbd61f637d5e3e98de2772eb 100644 (file)
@@ -472,6 +472,10 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
        if (bo_va->soffset) {
                /* add a clone of the bo_va to clear the old address */
                tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
+               if (!tmp) {
+                       mutex_unlock(&vm->mutex);
+                       return -ENOMEM;
+               }
                tmp->soffset = bo_va->soffset;
                tmp->eoffset = bo_va->eoffset;
                tmp->vm = vm;