[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/60] cxl/cdat: Handle cdat table build errors
From: |
Michael S. Tsirkin |
Subject: |
[PULL 37/60] cxl/cdat: Handle cdat table build errors |
Date: |
Wed, 14 Feb 2024 06:15:09 -0500 |
From: Ira Weiny <ira.weiny@intel.com>
The callback for building CDAT tables may return negative error codes.
This was previously unhandled and will result in potentially huge
allocations later on in ct3_build_cdat()
Detect the negative error code and defer cdat building.
Fixes: f5ee7413d592 ("hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange")
Cc: Huai-Cheng Kuo <hchkuo@avery-design.com.tw>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240126120132.24248-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/cxl/cxl-cdat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c
index 639a2db3e1..24829cf242 100644
--- a/hw/cxl/cxl-cdat.c
+++ b/hw/cxl/cxl-cdat.c
@@ -63,7 +63,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp)
cdat->built_buf_len = cdat->build_cdat_table(&cdat->built_buf,
cdat->private);
- if (!cdat->built_buf_len) {
+ if (cdat->built_buf_len <= 0) {
/* Build later as not all data available yet */
cdat->to_update = true;
return;
--
MST
- [PULL 33/60] vhost-user.rst: Fix vring address description, (continued)
- [PULL 33/60] vhost-user.rst: Fix vring address description, Michael S. Tsirkin, 2024/02/14
- [PULL 35/60] virtio_iommu: Clear IOMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 36/60] smmu: Clear SMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 34/60] MAINTAINERS: Drop myself as VT-d maintainers, Michael S. Tsirkin, 2024/02/14
- [PULL 40/60] cxl/cdat: Fix header sum value in CDAT checksum, Michael S. Tsirkin, 2024/02/14
- [PULL 39/60] hw/pci-bridge/cxl_upstream: Drop g_malloc() failure handling, Michael S. Tsirkin, 2024/02/14
- [PULL 41/60] hw/cxl/mbox: Remove dead code, Michael S. Tsirkin, 2024/02/14
- [PULL 42/60] hw/cxl/device: read from register values in mdev_reg_read(), Michael S. Tsirkin, 2024/02/14
- [PULL 46/60] tests/acpi: Allow update of DSDT.cxl, Michael S. Tsirkin, 2024/02/14
- [PULL 47/60] hw/i386: Fix _STA return value for ACPI0017, Michael S. Tsirkin, 2024/02/14
- [PULL 37/60] cxl/cdat: Handle cdat table build errors,
Michael S. Tsirkin <=
- [PULL 38/60] hw/mem/cxl_type3: Drop handling of failure of g_malloc0() and g_malloc(), Michael S. Tsirkin, 2024/02/14
- [PULL 43/60] hw/cxl: Pass CXLComponentState to cache_mem_ops, Michael S. Tsirkin, 2024/02/14
- [PULL 44/60] hw/cxl: Pass NULL for a NULL MemoryRegionOps, Michael S. Tsirkin, 2024/02/14
- [PULL 45/60] hw/mem/cxl_type3: Fix potential divide by zero reported by coverity, Michael S. Tsirkin, 2024/02/14
- [PULL 48/60] tests/acpi: Update DSDT.cxl to reflect change _STA return value., Michael S. Tsirkin, 2024/02/14
- [PULL 50/60] hw/cxl: Update link register definitions., Michael S. Tsirkin, 2024/02/14
- [PULL 54/60] virtio-gpu: Correct virgl_renderer_resource_get_info() error check, Michael S. Tsirkin, 2024/02/14
- [PULL 53/60] hw/cxl: Standardize all references on CXL r3.1 and minor updates, Michael S. Tsirkin, 2024/02/14
- [PULL 55/60] hw/smbios: Fix OEM strings table option validation, Michael S. Tsirkin, 2024/02/14
- [PULL 56/60] hw/smbios: Fix port connector option validation, Michael S. Tsirkin, 2024/02/14