KVM: PPC: Book3S HV: Free allocated memory if module init fails
authorFabiano Rosas <farosas@linux.ibm.com>
Tue, 25 Jan 2022 15:57:34 +0000 (12:57 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Feb 2022 05:50:44 +0000 (16:50 +1100)
commit175be7e5800e2782a7e38ee9e1b64633494c4b44
tree0f11ef9156f1605cf6a3802e502dccd9e0ec7124
parentc5d0d77b45265905bba2ce6e63c9a02bbd11c43c
KVM: PPC: Book3S HV: Free allocated memory if module init fails

The module's exit function is not called when the init fails, we need
to do cleanup before returning.

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-4-farosas@linux.ibm.com
arch/powerpc/kvm/book3s_hv.c