1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/qlogic/qede
Michal Schmidt aaa3c08ee0 qede: avoid uninitialized entries in coal_entry array
Even after commit 908d4bb7c5 ("qede: fix interrupt coalescing
configuration"), some entries of the coal_entry array may theoretically
be used uninitialized:

 1. qede_alloc_fp_array() allocates QEDE_MAX_RSS_CNT entries for
    coal_entry. The initial allocation uses kcalloc, so everything is
    initialized.
 2. The user sets a small number of queues (ethtool -L).
    coal_entry is reallocated for the actual small number of queues.
 3. The user sets a bigger number of queues.
    coal_entry is reallocated bigger. The added entries are not
    necessarily initialized.

In practice, the reallocations will actually keep using the originally
allocated region of memory, but we should not rely on it.

The reallocation is unnecessary. coal_entry can always have
QEDE_MAX_RSS_CNT entries.

Fixes: 908d4bb7c5 ("qede: fix interrupt coalescing configuration")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Nacked-by: Manish Chopra <manishc@marvell.com>
Acked-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-26 16:31:37 +00:00
..
Makefile net: qede: update copyright years 2020-06-30 15:51:40 -07:00
qede.h ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
qede_dcbnl.c net: qede: update copyright years 2020-06-30 15:51:40 -07:00
qede_ethtool.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
qede_filter.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
qede_fp.c qede: execute xdp_do_flush() before napi_complete_done() 2023-01-27 22:27:59 -08:00
qede_main.c qede: avoid uninitialized entries in coal_entry array 2023-02-26 16:31:37 +00:00
qede_ptp.c ptp: convert remaining drivers to adjfine interface 2022-11-11 10:58:39 +00:00
qede_ptp.h net: qede: update copyright years 2020-06-30 15:51:40 -07:00
qede_rdma.c net: qede: Use list_for_each_entry() to simplify code 2021-06-08 16:31:24 -07:00