]> 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:33:35 +0000 (14:33 +0200)
commit837adafac3d1227fb8fc9f620a15cd69a635fd40
treefa5af1cea7fbdda8db00901a5c52d2b14c817f48
parent37a73de168c0e81dfb61ca9e853a6697006ae28e
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