@@ -352,15 +352,13 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i
352352 int ret ;
353353 int i ;
354354
355- rx -> rx_ring = vmalloc (ipoib_recvq_size * sizeof * rx -> rx_ring );
355+ rx -> rx_ring = vzalloc (ipoib_recvq_size * sizeof * rx -> rx_ring );
356356 if (!rx -> rx_ring ) {
357357 printk (KERN_WARNING "%s: failed to allocate CM non-SRQ ring (%d entries)\n" ,
358358 priv -> ca -> name , ipoib_recvq_size );
359359 return - ENOMEM ;
360360 }
361361
362- memset (rx -> rx_ring , 0 , ipoib_recvq_size * sizeof * rx -> rx_ring );
363-
364362 t = kmalloc (sizeof * t , GFP_KERNEL );
365363 if (!t ) {
366364 ret = - ENOMEM ;
@@ -1097,13 +1095,12 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
10971095 struct ipoib_dev_priv * priv = netdev_priv (p -> dev );
10981096 int ret ;
10991097
1100- p -> tx_ring = vmalloc (ipoib_sendq_size * sizeof * p -> tx_ring );
1098+ p -> tx_ring = vzalloc (ipoib_sendq_size * sizeof * p -> tx_ring );
11011099 if (!p -> tx_ring ) {
11021100 ipoib_warn (priv , "failed to allocate tx ring\n" );
11031101 ret = - ENOMEM ;
11041102 goto err_tx ;
11051103 }
1106- memset (p -> tx_ring , 0 , ipoib_sendq_size * sizeof * p -> tx_ring );
11071104
11081105 p -> qp = ipoib_cm_create_tx_qp (p -> dev , p );
11091106 if (IS_ERR (p -> qp )) {
@@ -1521,7 +1518,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
15211518 return ;
15221519 }
15231520
1524- priv -> cm .srq_ring = vmalloc (ipoib_recvq_size * sizeof * priv -> cm .srq_ring );
1521+ priv -> cm .srq_ring = vzalloc (ipoib_recvq_size * sizeof * priv -> cm .srq_ring );
15251522 if (!priv -> cm .srq_ring ) {
15261523 printk (KERN_WARNING "%s: failed to allocate CM SRQ ring (%d entries)\n" ,
15271524 priv -> ca -> name , ipoib_recvq_size );
@@ -1530,7 +1527,6 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
15301527 return ;
15311528 }
15321529
1533- memset (priv -> cm .srq_ring , 0 , ipoib_recvq_size * sizeof * priv -> cm .srq_ring );
15341530}
15351531
15361532int ipoib_cm_dev_init (struct net_device * dev )
0 commit comments