]> 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:37:31 +0000 (14:37 +0200)
commitc4db297e889659b89669d88d8bf1d578b54068f7
tree56745f02b0f2588f9ecbde73ecb74d2152b73547
parenta278a4164bdec23be766d7a74b4fdb984c148408
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