qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] hw/cxl: Remove check for g_new0() failure


From: Jonathan Cameron
Subject: Re: [PATCH 2/2] hw/cxl: Remove check for g_new0() failure
Date: Thu, 26 Jan 2023 11:50:10 +0000

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 */
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]