summaryrefslogtreecommitdiffstats
path: root/src/net/netdevice.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-18 13:45:58 +0100
committerMichael Brown2007-01-18 13:45:58 +0100
commit06630a3036bc1a42696ba7f29235e75eddb4d562 (patch)
tree6bf503c4e9d9be0c1e5ae077c89ec357a61685da /src/net/netdevice.c
parentRespect the RX quota. This improves poll time by about 0.7us when the (diff)
downloadipxe-06630a3036bc1a42696ba7f29235e75eddb4d562.tar.gz
ipxe-06630a3036bc1a42696ba7f29235e75eddb4d562.tar.xz
ipxe-06630a3036bc1a42696ba7f29235e75eddb4d562.zip
Switch from calloc() to malloc()+memset() to match the practices used
almost everywhere else.
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r--src/net/netdevice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index 2827775b..7ed678ac 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -178,9 +178,12 @@ struct pk_buff * netdev_rx_dequeue ( struct net_device *netdev ) {
*/
struct net_device * alloc_netdev ( size_t priv_size ) {
struct net_device *netdev;
+ size_t total_len;
- netdev = calloc ( 1, sizeof ( *netdev ) + priv_size );
+ total_len = ( sizeof ( *netdev ) + priv_size );
+ netdev = malloc ( total_len );
if ( netdev ) {
+ memset ( netdev, 0, total_len );
INIT_LIST_HEAD ( &netdev->references );
INIT_LIST_HEAD ( &netdev->tx_queue );
INIT_LIST_HEAD ( &netdev->rx_queue );