diff mbox

drm/radeon: fix error handling in radeon_vm_bo_set_addr

Message ID 1406021443-1672-1-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König July 22, 2014, 9:30 a.m. UTC
From: Christian König <christian.koenig@amd.com>

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/radeon/radeon_vm.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index fa41e0d7..725d366 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;