]> git.baikalelectronics.ru Git - kernel.git/commit
interconnect: qcom: Fix uninitialized tcs_cmd::wait
authorMike Tipton <mdtipton@codeaurora.org>
Wed, 15 Apr 2020 13:03:27 +0000 (16:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 14:18:07 +0000 (16:18 +0200)
commit1f9e43d38b049b6ad53511d08f2525f876c8ed18
tree3dd4dfd0d759c43c84689182cd5c5d59b0985938
parent163b8fec4a91102fd17c9caa02967c1bc4202857
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.

Fixes: ef9ab990a2d9 ("interconnect: qcom: Consolidate interconnect RPMh support")
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200319231021.18108-1-mdtipton@codeaurora.org
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Link: https://lore.kernel.org/r/20200415130327.23059-2-georgi.djakov@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/interconnect/qcom/bcm-voter.c