[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/12] hw/pci-bridge/cxl_upstream: Drop g_malloc0() failure h
From: |
fan |
Subject: |
Re: [PATCH 03/12] hw/pci-bridge/cxl_upstream: Drop g_malloc0() failure handling |
Date: |
Wed, 24 Jan 2024 13:11:56 -0800 |
On Wed, Jan 24, 2024 at 12:40:51PM +0000, Jonathan Cameron wrote:
> As a failure of g_malloc0() will result in QEMU exiting, it
s/g_malloc0/g_malloc/
Fan
> won't return a NULL to check. As such, drop the incorrect handling
> of such NULL returns in the cdat table building code.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> hw/pci-bridge/cxl_upstream.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c
> index 36737189c6..d5341b530f 100644
> --- a/hw/pci-bridge/cxl_upstream.c
> +++ b/hw/pci-bridge/cxl_upstream.c
> @@ -228,9 +228,6 @@ static int build_cdat_table(CDATSubHeader ***cdat_table,
> void *priv)
>
> sslbis_size = sizeof(CDATSslbis) + sizeof(*sslbis_latency->sslbe) *
> count;
> sslbis_latency = g_malloc(sslbis_size);
> - if (!sslbis_latency) {
> - return -ENOMEM;
> - }
> *sslbis_latency = (CDATSslbis) {
> .sslbis_header = {
> .header = {
> @@ -251,9 +248,6 @@ static int build_cdat_table(CDATSubHeader ***cdat_table,
> void *priv)
> }
>
> sslbis_bandwidth = g_malloc(sslbis_size);
> - if (!sslbis_bandwidth) {
> - return 0;
> - }
> *sslbis_bandwidth = (CDATSslbis) {
> .sslbis_header = {
> .header = {
> --
> 2.39.2
>
- [PATCH 00/12 qemu] CXL emulation fixes and minor cleanup., Jonathan Cameron, 2024/01/24
- [PATCH 01/12] cxl/cdat: Handle cdat table build errors, Jonathan Cameron, 2024/01/24
- [PATCH 02/12] hw/mem/cxl_type3: Drop handling of failure of g_malloc0(), Jonathan Cameron, 2024/01/24
- [PATCH 03/12] hw/pci-bridge/cxl_upstream: Drop g_malloc0() failure handling, Jonathan Cameron, 2024/01/24
- Re: [PATCH 03/12] hw/pci-bridge/cxl_upstream: Drop g_malloc0() failure handling,
fan <=
- [PATCH 04/12] cxl/cdat: Fix header sum value in CDAT checksum, Jonathan Cameron, 2024/01/24
- [PATCH 05/12] hw/cxl/mbox: Remove dead code, Jonathan Cameron, 2024/01/24
- [PATCH 06/12] hw/cxl/device: read from register values in mdev_reg_read(), Jonathan Cameron, 2024/01/24
- [PATCH 07/12] hw/cxl: Pass CXLComponentState to cache_mem_ops, Jonathan Cameron, 2024/01/24
- [PATCH 08/12] hw/cxl: Pass NULL for a NULL MemoryRegionOps, Jonathan Cameron, 2024/01/24
- [PATCH 09/12] hw/mem/cxl_type3: Fix potential divide by zero reported by coverity, Jonathan Cameron, 2024/01/24