OSDN Git Service

crypto: ccp: Free SEV device if SEV init fails
authorSean Christopherson <seanjc@google.com>
Tue, 6 Apr 2021 22:49:45 +0000 (15:49 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 21 Apr 2021 16:20:05 +0000 (12:20 -0400)
commitb61a9071dc72a3c709192c0c00ab87c2b3de1d94
treecb691be65bdee6bcd2e46eb14c1799f73f927e17
parent6a443def87d2698f4fa2d7b57e7f4e5f0f61671a
crypto: ccp: Free SEV device if SEV init fails

Free the SEV device if later initialization fails.  The memory isn't
technically leaked as it's tracked in the top-level device's devres
list, but unless the top-level device is removed, the memory won't be
freed and is effectively leaked.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210406224952.4177376-2-seanjc@google.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
drivers/crypto/ccp/sev-dev.c