mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
interconnect: qcom: Fix uninitialized tcs_cmd::wait
Currently, if tcs_cmd_gen is called with commit=false, then tcs_cmd::wait is left uninitialized. Since the tcs_cmd structures passed to this function aren't zero-initialized, then we're left with random wait values. This results in waiting for completion for more commands than is necessary, depending on what's on the stack at the time. Removing the unnecessary if-condition fixes this, but add an explicit memset of the tcs_cmd structure as well to ensure predictable behavior if more tcs_cmd members are added in the future. Change-Id: Ib85f6bd76b5fa3b4295e998b2651485687a558df Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
This commit is contained in:
parent
f9c0b494bb
commit
91fbdd0c23
1 changed files with 3 additions and 2 deletions
|
|
@ -107,6 +107,8 @@ static inline void tcs_cmd_gen(struct tcs_cmd *cmd, u64 vote_x, u64 vote_y,
|
|||
if (!cmd)
|
||||
return;
|
||||
|
||||
memset(cmd, 0, sizeof(*cmd));
|
||||
|
||||
if (vote_x == 0 && vote_y == 0)
|
||||
valid = false;
|
||||
|
||||
|
|
@ -123,8 +125,7 @@ static inline void tcs_cmd_gen(struct tcs_cmd *cmd, u64 vote_x, u64 vote_y,
|
|||
* Set the wait for completion flag on command that need to be completed
|
||||
* before the next command.
|
||||
*/
|
||||
if (commit)
|
||||
cmd->wait = true;
|
||||
cmd->wait = commit;
|
||||
}
|
||||
|
||||
static void tcs_list_gen(struct list_head *bcm_list, int bucket,
|
||||
|
|
|
|||
Loading…
Reference in a new issue