diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-04-21 14:20:20 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-05-19 01:36:09 -0400 |
commit | 7b22a3218ad0b8388c8bf20d394e3220b2fc8798 (patch) | |
tree | f245d8f67b76d44434c91a1f5578423d25655c74 /hw/cxl/cxl-component-utils.c | |
parent | 71ba92f3488b64bd5c81e2872c56e88cea21bb95 (diff) |
hw/cxl: cdat: Fix failure to free buffer in erorr paths
The failure paths in CDAT file loading did not clear up properly.
Change to using g_auto_free and a local pointer for the buffer to
ensure this function has no side effects on error.
Also drop some unnecessary checks that can not fail.
Cleanup properly after a failure to load a CDAT file.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230421132020.7408-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/cxl/cxl-component-utils.c')
0 files changed, 0 insertions, 0 deletions