summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-07-22 11:30:43 +0200
committerAlex Deucher <alexander.deucher@amd.com>2014-07-22 12:21:58 -0400
commit5b7532756382cb31748f73df6a0af0138390c04f (patch)
tree5ff283926533f36ad983a67fa3de295b59b1775e /drivers
parentec8a362f2e6e380e7a1f66a6c9a7f6c237ab3520 (diff)
downloadlinux-5b7532756382cb31748f73df6a0af0138390c04f.tar.bz2
drm/radeon: fix error handling in radeon_vm_bo_set_addr
Signed-off-by: Christian König <christian.koenig@amd.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 fa41e0d7d17d..725d3669014f 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -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;