]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci-cadence: fix logically and structurally dead code
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Thu, 19 Apr 2018 15:59:58 +0000 (10:59 -0500)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 2 May 2018 13:08:49 +0000 (15:08 +0200)
commitfecd367e367f6d0d67ab31b50420822d51ce8b35
tree851c7b04edbf9f00c4f854945131cae558849f56
parentc34c3645e660e3305a6c79a3e7c6a7c8bd2d44b7
mmc: sdhci-cadence: fix logically and structurally dead code

Currently, the code block inside the for loop will never execute more than
once, because the function returns immediately after the first iteration,
hence the execution of the code at the second iteration is structurally
dead and, code at line 281: return 0; is never reached.

Fix this by checking _ret_ before return.

Addresses-Coverity-ID: 1468009 ("Logically dead code")
Addresses-Coverity-ID: 1468002 ("Structurally dead code")
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-cadence.c