[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/30] ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_o
From: |
David Gibson |
Subject: |
[PULL 12/30] ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts() |
Date: |
Fri, 4 Sep 2020 13:47:01 +1000 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
Since we're using the string just once, just use g_autofree and
avoid leaking it without calling g_free().
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200825215749.213536-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_nvdimm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c
index 81410aa63f..9a20a65640 100644
--- a/hw/ppc/spapr_nvdimm.c
+++ b/hw/ppc/spapr_nvdimm.c
@@ -33,7 +33,7 @@
void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
Error **errp)
{
- char *uuidstr = NULL;
+ g_autofree char *uuidstr = NULL;
QemuUUID uuid;
int ret;
@@ -54,7 +54,6 @@ void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm,
uint64_t size,
&error_abort);
ret = qemu_uuid_parse(uuidstr, &uuid);
g_assert(!ret);
- g_free(uuidstr);
if (qemu_uuid_is_null(&uuid)) {
error_setg(errp, "NVDIMM device requires the uuid to be set");
--
2.26.2
- [PULL 09/30] spapr/xive: Use kvmppc_xive_source_reset() in post_load, (continued)
- [PULL 09/30] spapr/xive: Use kvmppc_xive_source_reset() in post_load, David Gibson, 2020/09/03
- [PULL 03/30] spapr: Remove unnecessary DRC type-checker macros, David Gibson, 2020/09/03
- [PULL 05/30] ppc/pnv: Add a HIOMAP erase command, David Gibson, 2020/09/03
- [PULL 07/30] spapr/xive: Use the xics flag to check for XIVE-only IRQ backends, David Gibson, 2020/09/03
- [PULL 08/30] spapr/xive: Modify kvm_cpu_is_enabled() interface, David Gibson, 2020/09/03
- [PULL 11/30] spapr/xive: Allocate vCPU IPIs from the vCPU contexts, David Gibson, 2020/09/03
- [PULL 10/30] spapr/xive: Allocate IPIs independently from the other sources, David Gibson, 2020/09/03
- [PULL 18/30] ppc/e500: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 14/30] ppc/spapr_nvdimm: do not enable support with 'nvdimm=off', David Gibson, 2020/09/03
- [PULL 13/30] spapr, spapr_nvdimm: fold NVDIMM validation in the same place, David Gibson, 2020/09/03
- [PULL 12/30] ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts(),
David Gibson <=
- [PULL 17/30] ppc/spapr: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 15/30] target/arm: Move start-powered-off property to generic CPUState, David Gibson, 2020/09/03
- [PULL 19/30] mips/cps: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 16/30] target/arm: Move setting of CPU halted state to generic code, David Gibson, 2020/09/03
- [PULL 21/30] sparc/sun4m: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 20/30] sparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset(), David Gibson, 2020/09/03
- [PULL 22/30] target/s390x: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 23/30] hw/ppc/ppc4xx_pci: Use ARRAY_SIZE() instead of magic value, David Gibson, 2020/09/03
- [PULL 24/30] hw/ppc/ppc4xx_pci: Replace pointless warning by assert(), David Gibson, 2020/09/03
- [PULL 25/30] ppc: introducing spapr_numa.c NUMA code helper, David Gibson, 2020/09/03