mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
msm: eva: Adding kref count for cvp_get_inst_from_id
Adding count for instance Change-Id: I4505feb478c1c682ecf6a790d7cb804f70e50a1c Signed-off-by: Pranay Varma Kopanati <quic_pkopanat@quicinc.com>
This commit is contained in:
parent
3733cab2bf
commit
b651124b92
1 changed files with 5 additions and 2 deletions
|
|
@ -467,7 +467,7 @@ retry:
|
|||
}
|
||||
}
|
||||
|
||||
inst = match ? inst : NULL;
|
||||
inst = match && kref_get_unless_zero(&inst->kref) ? inst : NULL;
|
||||
mutex_unlock(&core->lock);
|
||||
} else {
|
||||
if (core->state == CVP_CORE_UNINIT)
|
||||
|
|
@ -519,7 +519,7 @@ static int hfi_process_session_cvp_msg(u32 device_id,
|
|||
sess_msg = kmem_cache_alloc(cvp_driver->msg_cache, GFP_KERNEL);
|
||||
if (sess_msg == NULL) {
|
||||
dprintk(CVP_ERR, "%s runs out msg cache memory\n", __func__);
|
||||
return -ENOMEM;
|
||||
goto error_no_mem;
|
||||
}
|
||||
|
||||
memcpy(&sess_msg->pkt, pkt, get_msg_size(pkt));
|
||||
|
|
@ -542,11 +542,14 @@ static int hfi_process_session_cvp_msg(u32 device_id,
|
|||
|
||||
info->response_type = HAL_NO_RESP;
|
||||
|
||||
cvp_put_inst(inst);
|
||||
return 0;
|
||||
|
||||
error_handle_msg:
|
||||
spin_unlock(&sq->lock);
|
||||
kmem_cache_free(cvp_driver->msg_cache, sess_msg);
|
||||
error_no_mem:
|
||||
cvp_put_inst(inst);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue