Skip to content
Commit aaa3c08e authored by Michal Schmidt's avatar Michal Schmidt Committed by David S. Miller
Browse files

qede: avoid uninitialized entries in coal_entry array



Even after commit 908d4bb7 ("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: 908d4bb7 ("qede: fix interrupt coalescing configuration")
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Nacked-by: default avatarManish Chopra <manishc@marvell.com>
Acked-by: default avatarManish Chopra <manishc@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50645610
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment