static scq_info *get_scq(ns_dev *card, int size, u32 scd)
{
scq_info *scq;
- int i;
if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
return NULL;
kfree(scq);
return NULL;
}
- scq->skb = kmalloc_array(size / NS_SCQE_SIZE,
- sizeof(*scq->skb),
- GFP_KERNEL);
+ scq->skb = kcalloc(size / NS_SCQE_SIZE, sizeof(*scq->skb),
+ GFP_KERNEL);
if (!scq->skb) {
dma_free_coherent(&card->pcidev->dev,
2 * size, scq->org, scq->dma);
scq->last = scq->base + (scq->num_entries - 1);
scq->tail = scq->last;
scq->scd = scd;
- scq->num_entries = size / NS_SCQE_SIZE;
scq->tbd_count = 0;
init_waitqueue_head(&scq->scqfull_waitq);
scq->full = 0;
spin_lock_init(&scq->lock);
- for (i = 0; i < scq->num_entries; i++)
- scq->skb[i] = NULL;
-
return scq;
}