Skip to contentSkip to conversation

s390x/cpumodel: Add missing visit_free

PATCH Applied Andrew Jones 3 participants 3 messages Oct 16, 2019 – Oct 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x/cpumodel: Add missing visit_free

Beata Michalska noticed this missing visit_free() while reviewing arm's implementation of qmp_query_cpu_model_expansion(), which is modeled off this s390x implementation.

---
 target/s390x/cpu_models.c | 1 +
 1 file changed, 1 insertion(+)
target/s390x/cpu_models.c +1 -0
index 009afc38b92d..7e92fb2e156d 100644
@@ -515,6 +515,7 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
         visitor = qobject_input_visitor_new(info->props);
         visit_start_struct(visitor, NULL, NULL, 0, errp);
         if (*errp) {
+            visit_free(visitor);
             object_unref(obj);
             return;
         }
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andrew Jones

Beata Michalska noticed this missing visit_free() while reviewing arm's implementation of qmp_query_cpu_model_expansion(), which is modeled off this s390x implementation.

Nice to see ARM support getting added.

Quoted 12 lines
---
  target/s390x/cpu_models.c | 1 +
  1 file changed, 1 insertion(+)
target/s390x/cpu_models.c +0 -0
index 009afc38b92d..7e92fb2e156d 100644

target/s390x/cpu_models.c static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info, · line 521

Quoted 7 lines
target/s390x/cpu_models.c +1 -0
@@ -515,6 +515,7 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
          visitor = qobject_input_visitor_new(info->props);
          visit_start_struct(visitor, NULL, NULL, 0, errp);
          if (*errp) {
+            visit_free(visitor);
              object_unref(obj);
              return;
          }

Right, thanks

Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw
In reply to Andrew Jones
Quoted 14 lines · On Wed, 16 Oct 2019 16:54:34 +0200 Andrew Jones <[email protected]> wrote:

Beata Michalska noticed this missing visit_free() while reviewing arm's implementation of qmp_query_cpu_model_expansion(), which is modeled off this s390x implementation.

---
 target/s390x/cpu_models.c | 1 +
 1 file changed, 1 insertion(+)
target/s390x/cpu_models.c +0 -0
index 009afc38b92d..7e92fb2e156d 100644

target/s390x/cpu_models.c static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info, · line 521

Quoted 7 lines
target/s390x/cpu_models.c +1 -0
@@ -515,6 +515,7 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
         visitor = qobject_input_visitor_new(info->props);
         visit_start_struct(visitor, NULL, NULL, 0, errp);
         if (*errp) {
+            visit_free(visitor);
             object_unref(obj);
             return;
         }

Thanks, applied.