]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: cavium - Fix the if condition to exit loop after timeout
authorEverest K.C <everestkc@everestkc.com.np>
Fri, 18 Oct 2024 16:23:10 +0000 (10:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:45 +0000 (19:50 +0100)
commitd465ea267167d557c196d537549d1b1a58b0e9b2
treef90045456b91f3416f834ac56417357af1b77977
parent96001f52ae8c70e2c736d3e1e5dc53d5b521e5ca
crypto: cavium - Fix the if condition to exit loop after timeout

[ Upstream commit 53d91ca76b6c426c546542a44c78507b42008c9e ]

The while loop breaks in the first run because of incorrect
if condition. It also causes the statements after the if to
appear dead.
Fix this by changing the condition from if(timeout--) to
if(!timeout--).

This bug was reported by Coverity Scan.
Report:
CID 1600859: (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: udelay(30UL);

Fixes: 9e2c7d99941d ("crypto: cavium - Add Support for Octeon-tx CPT Engine")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/cavium/cpt/cptpf_main.c