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

Commit 67cd9eb9 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Bail out if ocmem allocation failed



We shouldn't need to call venus_hfi_set_ocmem if the allocation of ocmem
failed.

Change-Id: I805f914af4d340fd50beecdb63b87c4cbda19fb0
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 02983880
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3112,14 +3112,14 @@ static int venus_hfi_alloc_ocmem(void *dev, unsigned long size)
		return -EINVAL;
	}
	ocmem_buffer = device->resources.ocmem.buf;
	if (!ocmem_buffer ||
		ocmem_buffer->len < size) {
	if (!ocmem_buffer || ocmem_buffer->len < size) {
		ocmem_buffer = ocmem_allocate(OCMEM_VIDEO, size);
		if (IS_ERR_OR_NULL(ocmem_buffer)) {
			dprintk(VIDC_ERR,
				"ocmem_allocate_nb failed: %d\n",
				(u32) ocmem_buffer);
			rc = -ENOMEM;
			goto ocmem_set_failed;
		}
		device->resources.ocmem.buf = ocmem_buffer;
		rc = venus_hfi_set_ocmem(device, ocmem_buffer);