qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 75de4e: nvdimm: Plug memory leak in uuid prop


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 75de4e: nvdimm: Plug memory leak in uuid property setter
Date: Thu, 28 May 2020 04:15:32 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 75de4efa00d2e3df5abfd6b35fc5b04e98443dd2
      
https://github.com/qemu/qemu/commit/75de4efa00d2e3df5abfd6b35fc5b04e98443dd2
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/mem/nvdimm.c

  Log Message:
  -----------
  nvdimm: Plug memory leak in uuid property setter

nvdimm_set_uuid() leaks memory on qemu_uuid_parse() failure.  Fix
that.

Fixes: 6c5627bb24dcd68c997857a8b671617333b1289f
Cc: Xiao Guangrong <xiaoguangrong.eric@gmail.com>
Cc: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-2-armbru@redhat.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>


  Commit: 56f9dde414053410857d0083e92e5b1b45cf33dc
      
https://github.com/qemu/qemu/commit/56f9dde414053410857d0083e92e5b1b45cf33dc
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/usb/xen-usb.c

  Log Message:
  -----------
  xen: Fix and improve handling of device_add usb-host errors

usbback_portid_add() leaks the error when qdev_device_add() fails.
Fix that.  While there, use the error to improve the error message.

The qemu_opts_from_qdict() similarly leaks on failure.  But any
failure there is a programming error.  Pass &error_abort.

Fixes: 816ac92ef769f9ffc534e49a1bb6177bddce7aa2
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Paul Durrant <paul@xen.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-3-armbru@redhat.com>
Acked-by: Paul Durrant <paul@xen.org>


  Commit: 5e959d2e6e698af86a7064ead87ebe47706d99c7
      
https://github.com/qemu/qemu/commit/5e959d2e6e698af86a7064ead87ebe47706d99c7
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M target/s390x/cpu_models.c

  Log Message:
  -----------
  s390x/cpumodel: Fix harmless misuse of visit_check_struct()

Commit e47970f51d "s390x/cpumodel: Fix query-cpu-model-FOO error API
violations" neglected to change visit_check_struct()'s Error **
argument along with the others.  If visit_check_struct() failed, we'd
take the success path.  Fortunately, it can't fail here:
qobject_input_check_struct() checks we consumed the whole dictionary,
and to get here, we did.  Fix it anyway.

Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20200505101908.6207-4-armbru@redhat.com>


  Commit: d01127584e70f9242d3dd9bf4c0bdc1980254713
      
https://github.com/qemu/qemu/commit/d01127584e70f9242d3dd9bf4c0bdc1980254713
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  tests/migration: Tighten error checking

migrate_get_socket_address() neglects to check
visit_type_SocketAddressList() failure.  This smells like a leak, but
it actually will crash dereferencing @addrs.  Pass &error_abort to
remove the code smell.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-5-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: 5217f1887a8041c51495fbd5d3f767d96a242000
      
https://github.com/qemu/qemu/commit/5217f1887a8041c51495fbd5d3f767d96a242000
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M chardev/char-socket.c
    M hw/sd/pxa2xx_mmci.c
    M hw/sd/sd.c
    M hw/usb/dev-mtp.c
    M qemu-nbd.c
    M scsi/qemu-pr-helper.c

  Log Message:
  -----------
  error: Use error_reportf_err() where appropriate

Replace

    error_report("...: %s", ..., error_get_pretty(err));

by

    error_reportf_err(err, "...: ", ...);

One of the replaced messages lacked a colon.  Add it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200505101908.6207-6-armbru@redhat.com>


  Commit: a729f9bc843a11230d6e7b460b2115e6a55a0f7e
      
https://github.com/qemu/qemu/commit/a729f9bc843a11230d6e7b460b2115e6a55a0f7e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/mips/mips_malta.c

  Log Message:
  -----------
  mips/malta: Fix create_cps() error handling

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second

create_cps() is wrong that way.  The last calls treats an error as
fatal.  Do that for the prior ones, too.

Fixes: bff384a4fbd5d0e86939092e74e766ef0f5f592c
Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200505101908.6207-7-armbru@redhat.com>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>


  Commit: 932d3a65c8bfe0c260d3564afc082c41febdd882
      
https://github.com/qemu/qemu/commit/932d3a65c8bfe0c260d3564afc082c41febdd882
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/mips/boston.c

  Log Message:
  -----------
  mips/boston: Fix boston_mach_init() error handling

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

boston_mach_init() is wrong that way.  The last calls treats an error
as fatal.  Do that for the prior ones, too.

Fixes: df1d8a1f29f567567b9d20be685a4241282e7005
Cc: Paul Burton <pburton@wavecomp.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-8-armbru@redhat.com>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>


  Commit: 3e1df4cc46678b155c9d721c73ab6e310d7dd546
      
https://github.com/qemu/qemu/commit/3e1df4cc46678b155c9d721c73ab6e310d7dd546
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/mips/boston.c

  Log Message:
  -----------
  mips/boston: Plug memory leak in boston_mach_init()

Fixes: df1d8a1f29f567567b9d20be685a4241282e7005
Cc: Paul Burton <pburton@wavecomp.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-9-armbru@redhat.com>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>


  Commit: 3b914406cf3cfb4ac48388c1ea15036b333b7a79
      
https://github.com/qemu/qemu/commit/3b914406cf3cfb4ac48388c1ea15036b333b7a79
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M hw/arm/sabrelite.c

  Log Message:
  -----------
  arm/sabrelite: Consistently use &error_fatal in sabrelite_init()

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Jean-Christophe Dubois <jcd@tribudubois.net>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200505101908.6207-10-armbru@redhat.com>
[Straightforward conflict with resolved d2623129a7 "qom: Drop
parameter @errp of object_property_add() & friends"]


  Commit: 49e2fa85ff04a9be89ed15f922c7d8dae2be9e74
      
https://github.com/qemu/qemu/commit/49e2fa85ff04a9be89ed15f922c7d8dae2be9e74
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M target/i386/cpu.c

  Log Message:
  -----------
  i386: Fix x86_cpu_load_model() error API violation

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

x86_cpu_load_model() is wrong that way.  Harmless, because its @errp
is always &error_abort.  To fix, cut out the @errp middleman.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-11-armbru@redhat.com>


  Commit: aacc7c8be2900f1f0a2a1bd241c5eeb58878bb28
      
https://github.com/qemu/qemu/commit/aacc7c8be2900f1f0a2a1bd241c5eeb58878bb28
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M chardev/char-socket.c
    M hw/arm/sabrelite.c
    M hw/mem/nvdimm.c
    M hw/mips/boston.c
    M hw/mips/malta.c
    M hw/sd/pxa2xx_mmci.c
    M hw/sd/sd.c
    M hw/usb/dev-mtp.c
    M hw/usb/xen-usb.c
    M qemu-nbd.c
    M scsi/qemu-pr-helper.c
    M target/i386/cpu.c
    M target/s390x/cpu_models.c
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-05-27' into 
staging

Error reporting patches for 2020-05-27

# gpg: Signature made Wed 27 May 2020 06:48:02 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-error-2020-05-27:
  i386: Fix x86_cpu_load_model() error API violation
  arm/sabrelite: Consistently use &error_fatal in sabrelite_init()
  mips/boston: Plug memory leak in boston_mach_init()
  mips/boston: Fix boston_mach_init() error handling
  mips/malta: Fix create_cps() error handling
  error: Use error_reportf_err() where appropriate
  tests/migration: Tighten error checking
  s390x/cpumodel: Fix harmless misuse of visit_check_struct()
  xen: Fix and improve handling of device_add usb-host errors
  nvdimm: Plug memory leak in uuid property setter

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/8b92b9ef8607...aacc7c8be290



reply via email to

[Prev in Thread] Current Thread [Next in Thread]