KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init
authorFabiano Rosas <farosas@linux.ibm.com>
Tue, 25 Jan 2022 15:57:32 +0000 (12:57 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:27 +0000 (14:23 +0200)
[ Upstream commit 69ab6ac380a00244575de02c406dcb9491bf3368 ]

The return of the function is being shadowed by the call to
kvmppc_uvmem_init.

Fixes: ca9f4942670c ("KVM: PPC: Book3S HV: Support for running secure guests")
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220125155735.1018683-2-farosas@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kvm/book3s_hv.c

index a2fd1db29f7e8642332101b4d419a72445b095b3..7fa68571166902fce6b2ea1d15078d242fe44cb4 100644 (file)
@@ -6101,8 +6101,11 @@ static int kvmppc_book3s_init_hv(void)
        if (r)
                return r;
 
-       if (kvmppc_radix_possible())
+       if (kvmppc_radix_possible()) {
                r = kvmppc_radix_init();
+               if (r)
+                       return r;
+       }
 
        r = kvmppc_uvmem_init();
        if (r < 0)