From 9d5ba49ad06207584e749819025966b748054b99 Mon Sep 17 00:00:00 2001 From: Akshata Sahukar Date: Wed, 15 Sep 2021 15:29:47 -0700 Subject: [PATCH] video: driver: reject opening 17th video instance Reject opening 17th video instance. Change-Id: Iebc6f8c915c2594e218acbabf4f8e6b70a5ce11d Signed-off-by: Akshata Sahukar --- driver/vidc/src/msm_vidc_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driver/vidc/src/msm_vidc_driver.c b/driver/vidc/src/msm_vidc_driver.c index 0aa9c75442..1be2ebd1b7 100644 --- a/driver/vidc/src/msm_vidc_driver.c +++ b/driver/vidc/src/msm_vidc_driver.c @@ -3602,11 +3602,11 @@ int msm_vidc_add_session(struct msm_vidc_inst *inst) list_for_each_entry(i, &core->instances, list) count++; - if (count <= core->capabilities[MAX_SESSION_COUNT].value) { + if (count < core->capabilities[MAX_SESSION_COUNT].value) { list_add_tail(&inst->list, &core->instances); } else { - i_vpr_e(inst, "%s: total sessions %d exceeded max limit %d\n", - __func__, count, core->capabilities[MAX_SESSION_COUNT].value); + i_vpr_e(inst, "%s: max limit %d already running %d sessions\n", + __func__, core->capabilities[MAX_SESSION_COUNT].value, count); rc = -EINVAL; } core_unlock(core, __func__);