qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	qemu-trivial@nongnu.org,
	"Francisco Iglesias" <frasse.iglesias@gmail.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Tong Ho" <tong.ho@xilinx.com>
Subject: [PULL 07/11] hw/nvram: Fix Memory Leak in Xilinx Versal eFuse device
Date: Sat, 23 Oct 2021 20:31:19 +0200	[thread overview]
Message-ID: <20211023183123.813116-8-laurent@vivier.eu> (raw)
In-Reply-To: <20211023183123.813116-1-laurent@vivier.eu>

From: Tong Ho <tong.ho@xilinx.com>

Signed-off-by: Tong Ho <tong.ho@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211015203532.2463705-3-tong.ho@xilinx.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/nvram/xlnx-versal-efuse-ctrl.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse-ctrl.c
index d3623767032c..b35ba65ab57b 100644
--- a/hw/nvram/xlnx-versal-efuse-ctrl.c
+++ b/hw/nvram/xlnx-versal-efuse-ctrl.c
@@ -439,9 +439,11 @@ static void efuse_pgm_addr_postw(RegisterInfo *reg, uint64_t val64)
      *       up to guest to do so (or by reset).
      */
     if (efuse_pgm_locked(s, bit)) {
+        g_autofree char *path = object_get_canonical_path(OBJECT(s));
+
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Denied setting of efuse<%u, %u, %u>\n",
-                      object_get_canonical_path(OBJECT(s)),
+                      path,
                       FIELD_EX32(bit, EFUSE_PGM_ADDR, PAGE),
                       FIELD_EX32(bit, EFUSE_PGM_ADDR, ROW),
                       FIELD_EX32(bit, EFUSE_PGM_ADDR, COLUMN));
@@ -478,9 +480,11 @@ static void efuse_rd_addr_postw(RegisterInfo *reg, uint64_t val64)
     s->regs[R_EFUSE_RD_DATA] = xlnx_versal_efuse_read_row(s->efuse,
                                                           bit, &denied);
     if (denied) {
+        g_autofree char *path = object_get_canonical_path(OBJECT(s));
+
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Denied reading of efuse<%u, %u>\n",
-                      object_get_canonical_path(OBJECT(s)),
+                      path,
                       FIELD_EX32(bit, EFUSE_RD_ADDR, PAGE),
                       FIELD_EX32(bit, EFUSE_RD_ADDR, ROW));
 
@@ -625,9 +629,11 @@ static void efuse_ctrl_reg_write(void *opaque, hwaddr addr,
     s = XLNX_VERSAL_EFUSE_CTRL(dev);
 
     if (addr != A_WR_LOCK && s->regs[R_WR_LOCK]) {
+        g_autofree char *path = object_get_canonical_path(OBJECT(s));
+
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s[reg_0x%02lx]: Attempt to write locked register.\n",
-                      object_get_canonical_path(OBJECT(s)), (long)addr);
+                      path, (long)addr);
     } else {
         register_write_memory(opaque, addr, data, size);
     }
@@ -681,16 +687,20 @@ static void efuse_ctrl_realize(DeviceState *dev, Error **errp)
     const uint32_t lks_sz = sizeof(XlnxEFuseLkSpec) / 2;
 
     if (!s->efuse) {
+        g_autofree char *path = object_get_canonical_path(OBJECT(s));
+
         error_setg(errp, "%s.efuse: link property not connected to XLNX-EFUSE",
-                   object_get_canonical_path(OBJECT(dev)));
+                   path);
         return;
     }
 
     /* Sort property-defined pgm-locks for bsearch lookup */
     if ((s->extra_pg0_lock_n16 % lks_sz) != 0) {
+        g_autofree char *path = object_get_canonical_path(OBJECT(s));
+
         error_setg(errp,
                    "%s.pg0-lock: array property item-count not multiple of %u",
-                   object_get_canonical_path(OBJECT(dev)), lks_sz);
+                   path, lks_sz);
         return;
     }
 
-- 
2.31.1



  parent reply	other threads:[~2021-10-23 18:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 18:31 [PULL 00/11] Trivial branch for 6.2 patches Laurent Vivier
2021-10-23 18:31 ` [PULL 01/11] po: update turkish translation Laurent Vivier
2021-10-23 18:31 ` [PULL 02/11] disas/nios2: Fix style in print_insn_nios2() Laurent Vivier
2021-10-23 18:31 ` [PULL 03/11] disas/nios2: Simplify endianess conversion Laurent Vivier
2021-10-23 18:31 ` [PULL 04/11] MAINTAINERS: Add myself as reviewer of 'Machine core' API Laurent Vivier
2021-10-23 18:31 ` [PULL 05/11] softmmu/physmem.c: Fix typo in comment Laurent Vivier
2021-10-23 18:31 ` [PULL 06/11] hw/nvram: Fix Memory Leak in Xilinx eFuse QOM Laurent Vivier
2021-10-23 18:31 ` Laurent Vivier [this message]
2021-10-23 18:31 ` [PULL 08/11] hw/nvram: Fix Memory Leak in Xilinx ZynqMP eFuse device Laurent Vivier
2021-10-23 18:31 ` [PULL 09/11] README: Fix some documentation URLs Laurent Vivier
2021-10-23 18:31 ` [PULL 10/11] analyze-migration.py: fix a long standing typo Laurent Vivier
2021-10-23 18:31 ` [PULL 11/11] analyze-migration.py: fix extract contents ('-x') errors Laurent Vivier
2021-10-23 23:22 ` [PULL 00/11] Trivial branch for 6.2 patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211023183123.813116-8-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=edgar.iglesias@xilinx.com \
    --cc=f4bug@amsat.org \
    --cc=frasse.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=tong.ho@xilinx.com \
    --subject='Re: [PULL 07/11] hw/nvram: Fix Memory Leak in Xilinx Versal eFuse device' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).