Commit 00587f2f authored by Rick Farrington's avatar Rick Farrington Committed by David S. Miller

liquidio: lowmem: init allocated memory to 0

Fix GPF in octeon_init_droq(); zero the allocated block 'recv_buf_list'.
This prevents a GPF trying to access an invalid 'recv_buf_list[i]' entry
in octeon_droq_destroy_ring_buffers() if init didn't alloc all entries.
Signed-off-by: default avatarRick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: default avatarSatanand Burla <satananda.burla@cavium.com>
Signed-off-by: default avatarRaghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 741912c5
...@@ -275,12 +275,12 @@ int octeon_init_droq(struct octeon_device *oct, ...@@ -275,12 +275,12 @@ int octeon_init_droq(struct octeon_device *oct,
droq->max_count); droq->max_count);
droq->recv_buf_list = (struct octeon_recv_buffer *) droq->recv_buf_list = (struct octeon_recv_buffer *)
vmalloc_node(droq->max_count * vzalloc_node(droq->max_count *
OCT_DROQ_RECVBUF_SIZE, OCT_DROQ_RECVBUF_SIZE,
numa_node); numa_node);
if (!droq->recv_buf_list) if (!droq->recv_buf_list)
droq->recv_buf_list = (struct octeon_recv_buffer *) droq->recv_buf_list = (struct octeon_recv_buffer *)
vmalloc(droq->max_count * vzalloc(droq->max_count *
OCT_DROQ_RECVBUF_SIZE); OCT_DROQ_RECVBUF_SIZE);
if (!droq->recv_buf_list) { if (!droq->recv_buf_list) {
dev_err(&oct->pci_dev->dev, "Output queue recv buf list alloc failed\n"); dev_err(&oct->pci_dev->dev, "Output queue recv buf list alloc failed\n");
......
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