]> git.baikalelectronics.ru Git - kernel.git/commit
gve: Fix the queue page list allocated pages count
authorJeroen de Borst <jeroendb@google.com>
Tue, 26 Nov 2019 23:36:19 +0000 (15:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Nov 2019 23:52:34 +0000 (15:52 -0800)
commit7a519986465f52efec81b9f6d07411f6f9fc7377
tree8af5f4a1bced8d7be348dc9c70ddd127ce3a67c1
parent1b552ab9cb22b0a2ed58d10100f5d43236bc7ec3
gve: Fix the queue page list allocated pages count

In gve_alloc_queue_page_list(), when a page allocation fails,
qpl->num_entries will be wrong.  In this case priv->num_registered_pages
can underflow in gve_free_queue_page_list(), causing subsequent calls
to gve_alloc_queue_page_list() to fail.

Fixes: 17b7b5dff8f1 ("gve: Add transmit and receive support")
Signed-off-by: Jeroen de Borst <jeroendb@google.com>
Reviewed-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/google/gve/gve_main.c