From: Jonathan Cameron <Jonathan.Cameron@huawei.com> To: Ira Weiny <ira.weiny@intel.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> Subject: Re: [PATCH 2/2] hw/cxl: Remove check for g_new0() failure Date: Thu, 26 Jan 2023 11:50:10 +0000 [thread overview] Message-ID: <20230126115010.00005289@huawei.com> (raw) In-Reply-To: <20230125-ira-cxl-events-fixups-2023-01-11-v1-2-1931378515f5@intel.com> On Wed, 25 Jan 2023 21:37:28 -0800 Ira Weiny <ira.weiny@intel.com> wrote: > 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> Squashed into original patch. Thanks, Jonathan > --- > 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 */ >
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org> To: Ira Weiny <ira.weiny@intel.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> Subject: Re: [PATCH 2/2] hw/cxl: Remove check for g_new0() failure Date: Thu, 26 Jan 2023 11:50:10 +0000 [thread overview] Message-ID: <20230126115010.00005289@huawei.com> (raw) In-Reply-To: <20230125-ira-cxl-events-fixups-2023-01-11-v1-2-1931378515f5@intel.com> On Wed, 25 Jan 2023 21:37:28 -0800 Ira Weiny <ira.weiny@intel.com> wrote: > 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> Squashed into original patch. Thanks, Jonathan > --- > 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 */ >
next prev parent reply other threads:[~2023-01-26 11:50 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 ` [PATCH 2/2] hw/cxl: Remove check for g_new0() failure Ira Weiny 2023-01-26 11:50 ` Jonathan Cameron [this message] 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=20230126115010.00005289@huawei.com \ --to=jonathan.cameron@huawei.com \ --cc=bwidawsk@kernel.org \ --cc=ira.weiny@intel.com \ --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: linkBe 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.