mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 06:22:01 +03:00
Switch from calloc() to malloc()+memset() to match the practices used
almost everywhere else.
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user