mirror of
https://github.com/ipxe/ipxe
synced 2025-12-13 15:31:42 +03:00
convert to zalloc
This commit is contained in:
@@ -265,9 +265,8 @@ struct net_device * alloc_netdev ( size_t priv_size ) {
|
|||||||
size_t total_len;
|
size_t total_len;
|
||||||
|
|
||||||
total_len = ( sizeof ( *netdev ) + priv_size );
|
total_len = ( sizeof ( *netdev ) + priv_size );
|
||||||
netdev = malloc ( total_len );
|
netdev = zalloc ( total_len );
|
||||||
if ( netdev ) {
|
if ( netdev ) {
|
||||||
memset ( netdev, 0, total_len );
|
|
||||||
netdev->refcnt.free = free_netdev;
|
netdev->refcnt.free = free_netdev;
|
||||||
INIT_LIST_HEAD ( &netdev->tx_queue );
|
INIT_LIST_HEAD ( &netdev->tx_queue );
|
||||||
INIT_LIST_HEAD ( &netdev->rx_queue );
|
INIT_LIST_HEAD ( &netdev->rx_queue );
|
||||||
|
|||||||
Reference in New Issue
Block a user