Commit 7f7adc50 authored by Nathan Fontenot's avatar Nathan Fontenot Committed by David S. Miller

ibmvnic: Allocate zero-filled memory for sub crqs

Update the allocation of memory for the sub crq structs and their
associated pages to allocate zero-filled memory.
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd9c20fa
...@@ -1360,12 +1360,12 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter ...@@ -1360,12 +1360,12 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter
struct ibmvnic_sub_crq_queue *scrq; struct ibmvnic_sub_crq_queue *scrq;
int rc; int rc;
scrq = kmalloc(sizeof(*scrq), GFP_ATOMIC); scrq = kzalloc(sizeof(*scrq), GFP_ATOMIC);
if (!scrq) if (!scrq)
return NULL; return NULL;
scrq->msgs = (union sub_crq *)__get_free_pages(GFP_ATOMIC, 2); scrq->msgs =
memset(scrq->msgs, 0, 4 * PAGE_SIZE); (union sub_crq *)__get_free_pages(GFP_ATOMIC | __GFP_ZERO, 2);
if (!scrq->msgs) { if (!scrq->msgs) {
dev_warn(dev, "Couldn't allocate crq queue messages page\n"); dev_warn(dev, "Couldn't allocate crq queue messages page\n");
goto zero_page_failed; goto zero_page_failed;
...@@ -1393,9 +1393,6 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter ...@@ -1393,9 +1393,6 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter
scrq->adapter = adapter; scrq->adapter = adapter;
scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs); scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs);
scrq->cur = 0;
atomic_set(&scrq->used, 0);
scrq->rx_skb_top = NULL;
spin_lock_init(&scrq->lock); spin_lock_init(&scrq->lock);
netdev_dbg(adapter->netdev, netdev_dbg(adapter->netdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment