diff options
author | Vadim Lomovtsev <Vadim.Lomovtsev@cavium.com> | 2018-04-09 15:24:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-09 16:59:38 +0200 |
commit | 9b5c4dfb2a6390bfb0166770d0d776ce0d3cdebd (patch) | |
tree | 683089621fed6136aa6e29c36d69041edcadfbd3 /drivers/net/ethernet/cavium/thunder/nic.h | |
parent | inetpeer: fix uninit-value in inet_getpeer (diff) | |
download | linux-9b5c4dfb2a6390bfb0166770d0d776ce0d3cdebd.tar.xz linux-9b5c4dfb2a6390bfb0166770d0d776ce0d3cdebd.zip |
net: thunderx: rework mac addresses list to u64 array
It is too expensive to pass u64 values via linked list, instead
allocate array for them by overall number of mac addresses from netdev.
This eventually removes multiple kmalloc() calls, aviod memory
fragmentation and allow to put single null check on kmalloc
return value in order to prevent a potential null pointer dereference.
Addresses-Coverity-ID: 1467429 ("Dereference null return value")
Fixes: 37c3347eb247 ("net: thunderx: add ndo_set_rx_mode callback implementation for VF")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic.h')
-rw-r--r-- | drivers/net/ethernet/cavium/thunder/nic.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h index 5fc46c5a4f36..448d1fafc827 100644 --- a/drivers/net/ethernet/cavium/thunder/nic.h +++ b/drivers/net/ethernet/cavium/thunder/nic.h @@ -265,14 +265,9 @@ struct nicvf_drv_stats { struct cavium_ptp; -struct xcast_addr { - struct list_head list; - u64 addr; -}; - struct xcast_addr_list { - struct list_head list; int count; + u64 mc[]; }; struct nicvf_work { |