mbox series

[0/7] various: 7 minor Coverity fixes

Message ID 20240312183810.557768-1-peter.maydell@linaro.org
Headers show
Series various: 7 minor Coverity fixes | expand

Message

Peter Maydell March 12, 2024, 6:38 p.m. UTC
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(-)

Comments

Richard Henderson March 12, 2024, 7:06 p.m. UTC | #1
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~