Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68b1ea30 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4fb0bbd5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;