All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Tsirkin <mst@redhat.com>,
	Ben Widawsky <bwidawsk@kernel.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, linux-cxl@vger.kernel.org,
	Ira Weiny <ira.weiny@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Subject: [PATCH 2/2] hw/cxl: Remove check for g_new0() failure
Date: Wed, 25 Jan 2023 21:37:28 -0800	[thread overview]
Message-ID: <20230125-ira-cxl-events-fixups-2023-01-11-v1-2-1931378515f5@intel.com> (raw)
In-Reply-To: <20230125-ira-cxl-events-fixups-2023-01-11-v1-0-1931378515f5@intel.com>

g_new0() will terminate the application if it fails.  Remove the check.

Fixes: fb64c5661d5f ("hw/cxl/events: Wire up get/clear event mailbox commands")
Reported-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 hw/cxl/cxl-events.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/cxl/cxl-events.c b/hw/cxl/cxl-events.c
index 2536aafc55fb..4cbc838e8ff4 100644
--- a/hw/cxl/cxl-events.c
+++ b/hw/cxl/cxl-events.c
@@ -124,13 +124,7 @@ bool cxl_event_insert(CXLDeviceState *cxlds,
     }
 
     entry = g_new0(CXLEvent, 1);
-    if (!entry) {
-        error_report("Failed to allocate memory for event log entry");
-        return false;
-    }
-
     memcpy(&entry->data, event, sizeof(*event));
-
     entry->data.hdr.handle = cpu_to_le16(log->next_handle);
     log->next_handle++;
     /* 0 handle is never valid */

-- 
2.39.1

  parent reply	other threads:[~2023-01-26  5:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  5:37 [PATCH 0/2] hw/cxl: CXL Event processing fixups Ira Weiny
2023-01-26  5:37 ` [PATCH 1/2] hw/cxl: Fix event log time stamp fields Ira Weiny
2023-01-26 11:41   ` Jonathan Cameron
2023-01-26 11:41     ` Jonathan Cameron via
2023-01-26 16:34     ` Ira Weiny
2023-01-26  5:37 ` Ira Weiny [this message]
2023-01-26 11:50   ` [PATCH 2/2] hw/cxl: Remove check for g_new0() failure Jonathan Cameron
2023-01-26 11:50     ` Jonathan Cameron via

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=20230125-ira-cxl-events-fixups-2023-01-11-v1-2-1931378515f5@intel.com \
    --to=ira.weiny@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bwidawsk@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.