qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta@amd.com>
To: <qemu-devel@nongnu.org>
Cc: <brijesh.singh@amd.com>, <dovmurik@linux.ibm.com>,
	<armbru@redhat.com>, <michael.roth@amd.com>,
	<pbonzini@redhat.com>, <thomas.lendacky@amd.com>,
	<peter.maydell@linaro.org>, <pankaj.gupta@amd.com>
Subject: [PATCH 3/3] i386/sev: Return when sev_common is null
Date: Fri, 7 Jun 2024 13:36:11 -0500	[thread overview]
Message-ID: <20240607183611.1111100-4-pankaj.gupta@amd.com> (raw)
In-Reply-To: <20240607183611.1111100-1-pankaj.gupta@amd.com>

coverity #1546885

fixes: 16dcf200dc ("i386/sev: Introduce "sev-common" type to encapsulate common SEV state")
Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
---
 target/i386/sev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/sev.c b/target/i386/sev.c
index f18432f58e..c40562dce3 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -587,6 +587,7 @@ static SevCapability *sev_get_capabilities(Error **errp)
     sev_common = SEV_COMMON(MACHINE(qdev_get_machine())->cgs);
     if (!sev_common) {
         error_setg(errp, "SEV is not configured");
+        return NULL;
     }
 
     sev_device = object_property_get_str(OBJECT(sev_common), "sev-device",
-- 
2.34.1



  parent reply	other threads:[~2024-06-07 23:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 18:36 [PATCH 0/3] snp: fix coverity reported issues Pankaj Gupta
2024-06-07 18:36 ` [PATCH 1/3] i386/sev: fix unreachable code coverity issue Pankaj Gupta
2024-06-10  5:35   ` Markus Armbruster
2024-06-07 18:36 ` [PATCH 2/3] i386/sev: Move SEV_COMMON null check before dereferencing Pankaj Gupta
2024-06-07 18:36 ` Pankaj Gupta [this message]
2024-06-11 12:26 ` [PATCH 0/3] snp: fix coverity reported issues Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240607183611.1111100-4-pankaj.gupta@amd.com \
    --to=pankaj.gupta@amd.com \
    --cc=armbru@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=dovmurik@linux.ibm.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).