Commit 5866bce0 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman

staging: vc04_services: vchiq_arm: fix error return code of...

staging: vc04_services: vchiq_arm: fix error return code of vchiq_release_internal() and vchiq_use_internal()

When arm_state is NULL, no error return code of vchiq_release_internal()
and vchiq_use_internal() is assigned.
To fix this bug, ret is assigned with VCHIQ_ERROR.
Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210306132245.16811-1-baijiaju1990@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 275b6bd5
...@@ -2332,8 +2332,10 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, ...@@ -2332,8 +2332,10 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
int *entity_uc; int *entity_uc;
int local_uc; int local_uc;
if (!arm_state) if (!arm_state) {
ret = VCHIQ_ERROR;
goto out; goto out;
}
vchiq_log_trace(vchiq_susp_log_level, "%s", __func__); vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
...@@ -2389,8 +2391,10 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service) ...@@ -2389,8 +2391,10 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
char entity[16]; char entity[16];
int *entity_uc; int *entity_uc;
if (!arm_state) if (!arm_state) {
ret = VCHIQ_ERROR;
goto out; goto out;
}
vchiq_log_trace(vchiq_susp_log_level, "%s", __func__); vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment