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

Commit 7bcf026d authored by Vikash Garodia's avatar Vikash Garodia
Browse files

msm: vidc: keep ocmem availability check while allocation



Keep the ocmem availability check before ocmem_alloc
declares it as failure.

Change-Id: I558566adea04447a23c5a3c3c925bb2603e15fba
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent e7c6d026
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1019,13 +1019,13 @@ static int __alloc_ocmem(void *dev, unsigned long size, bool locked)
	struct ocmem_buf *ocmem_buffer;
	struct ocmem_buf *ocmem_buffer;
	struct venus_hfi_device *device = dev;
	struct venus_hfi_device *device = dev;


	if (device && !device->res->ocmem_size)
		return rc;
	if (!device || !size) {
	if (!device || !size) {
		dprintk(VIDC_ERR, "%s Invalid param, core: %p, size: %lu\n",
		dprintk(VIDC_ERR, "%s Invalid param, core: %p, size: %lu\n",
			__func__, device, size);
			__func__, device, size);
		return -EINVAL;
		return -EINVAL;
	}
	}
	if (!device->res->ocmem_size)
		return rc;


	ocmem_buffer = device->resources.ocmem.buf;
	ocmem_buffer = device->resources.ocmem.buf;
	if (!ocmem_buffer ||
	if (!ocmem_buffer ||