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

Commit 72f7c739 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Remove unnecessary get/put_inst()"

parents 400f1807 b22f9fa5
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -3837,13 +3837,17 @@ int msm_vidc_comm_cmd(void *instance, union msm_v4l2_cmd *cmd)
		struct eos_buf *binfo = NULL;
		u32 smem_flags = SMEM_UNCACHED;

		get_inst(inst->core, inst);
		if (inst->state != MSM_VIDC_START_DONE) {
			dprintk(VIDC_DBG,
				"Inst = %pK is not ready for EOS\n", inst);
			break;
		}

		binfo = kzalloc(sizeof(*binfo), GFP_KERNEL);
		if (!binfo) {
			dprintk(VIDC_ERR, "%s: Out of memory\n", __func__);
			rc = -ENOMEM;
			goto exit;
			break;
		}

		if (inst->flags & VIDC_SECURE)
@@ -3853,26 +3857,25 @@ int msm_vidc_comm_cmd(void *instance, union msm_v4l2_cmd *cmd)
				SZ_4K, 1, smem_flags,
				HAL_BUFFER_INPUT, 0, &binfo->smem);
		if (rc) {
			kfree(binfo);
			dprintk(VIDC_ERR,
				"Failed to allocate output memory\n");
			rc = -ENOMEM;
			goto exit;
			break;
		}

		mutex_lock(&inst->eosbufs.lock);
		list_add_tail(&binfo->list, &inst->eosbufs.list);
		mutex_unlock(&inst->eosbufs.lock);

		if (inst->state != MSM_VIDC_START_DONE) {
			dprintk(VIDC_DBG,
				"Inst = %pK is not ready for EOS\n", inst);
			goto exit;
		}

		rc = msm_vidc_send_pending_eos_buffers(inst);

exit:
		put_inst(inst);
		if (rc) {
			dprintk(VIDC_ERR,
				"Failed pending_eos_buffers sending\n");
			list_del(&binfo->list);
			kfree(binfo);
			break;
		}
		break;
	}
	default: