[PATCH 0/7] various: 7 minor Coverity fixes

Peter Maydell posted 7 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240312183810.557768-1-peter.maydell@linaro.org
Maintainers: Glenn Miles <milesg@linux.vnet.ibm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Ilya Maximets <i.maximets@ovn.org>, Jason Wang <jasowang@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Alberto Garcia <berto@igalia.com>
hw/misc/pca9554.c              | 4 ++--
hw/nvram/mac_nvram.c           | 5 ++++-
net/af-xdp.c                   | 3 +--
tests/qtest/libqtest.c         | 6 +++++-
tests/qtest/npcm7xx_emc-test.c | 4 ++--
tests/unit/socket-helpers.c    | 4 +++-
tests/unit/test-throttle.c     | 4 ++--
7 files changed, 19 insertions(+), 11 deletions(-)
[PATCH 0/7] various: 7 minor Coverity fixes
Posted by Peter Maydell 1 month, 2 weeks ago
This patchset fixes seven minor Coverity issues:
 * four minor nits in test code
 * a happens-once memory leak in the af-xdp netdev
 * a harmless wrong-bounds-check in pca9554
 * add a report-write-errors-to-user in mac_nvram

I don't think any of these are worth backporting to stable;
I just picked them as easy fixes that reduce the number of open
Coverity issues we have.

thanks
-- PMM

Peter Maydell (7):
  tests/qtest/npcm7xx_emc_test: Don't leak cmd_line
  tests/unit/socket-helpers: Don't close(-1)
  net/af-xdp.c: Don't leak sock_fds array in net_init_af_xdp()
  hw/misc/pca9554: Correct error check bounds in get/set pin functions
  hw/nvram/mac_nvram: Report failure to write data
  tests/unit/test-throttle: Avoid unintended integer division
  tests/qtest/libqtest.c: Check for g_setenv() failure

 hw/misc/pca9554.c              | 4 ++--
 hw/nvram/mac_nvram.c           | 5 ++++-
 net/af-xdp.c                   | 3 +--
 tests/qtest/libqtest.c         | 6 +++++-
 tests/qtest/npcm7xx_emc-test.c | 4 ++--
 tests/unit/socket-helpers.c    | 4 +++-
 tests/unit/test-throttle.c     | 4 ++--
 7 files changed, 19 insertions(+), 11 deletions(-)

-- 
2.34.1
Re: [PATCH 0/7] various: 7 minor Coverity fixes
Posted by Richard Henderson 1 month, 2 weeks ago
On 3/12/24 08:38, Peter Maydell wrote:
> Peter Maydell (7):
>    tests/qtest/npcm7xx_emc_test: Don't leak cmd_line
>    tests/unit/socket-helpers: Don't close(-1)
>    net/af-xdp.c: Don't leak sock_fds array in net_init_af_xdp()
>    hw/misc/pca9554: Correct error check bounds in get/set pin functions
>    hw/nvram/mac_nvram: Report failure to write data
>    tests/unit/test-throttle: Avoid unintended integer division
>    tests/qtest/libqtest.c: Check for g_setenv() failure

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~