Skip to content

Commit

Permalink
staging: vc04_services: vchiq_arm: fix error return code of vchiq_rel…
Browse files Browse the repository at this point in the history
…ease_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: TOTE Robot <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
XidianGeneral authored and gregkh committed Mar 10, 2021
1 parent 275b6bd commit 5866bce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2332,8 +2332,10 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
int *entity_uc;
int local_uc;

if (!arm_state)
if (!arm_state) {
ret = VCHIQ_ERROR;
goto out;
}

vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);

Expand Down Expand Up @@ -2389,8 +2391,10 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
char entity[16];
int *entity_uc;

if (!arm_state)
if (!arm_state) {
ret = VCHIQ_ERROR;
goto out;
}

vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);

Expand Down

0 comments on commit 5866bce

Please sign in to comment.