]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: nx - Fix uninitialised hv_nxc on error
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 15 Mar 2025 08:50:42 +0000 (16:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:32:01 +0000 (14:32 +0200)
commit6d662e7666f218ef787a368b5b81512a1940f5dc
treed96039b3fedf83e19feb67ae156de9ea7adec8b4
parenta2d672786704387533beb3fe5e61ebcbca38a142
crypto: nx - Fix uninitialised hv_nxc on error

[ Upstream commit 9b00eb923f3e60ca76cbc8b31123716f3a87ac6a ]

The compiler correctly warns that hv_nxc may be used uninitialised
as that will occur when NX-GZIP is unavailable.

Fix it by rearranging the code and delay setting caps_feat until
the final query succeeds.

Fixes: b4ba22114c78 ("crypto/nx: Get NX capabilities for GZIP coprocessor type")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/nx/nx-common-pseries.c