]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2019 21:34:14 +0000 (22:34 +0100)
commit071598ee0440c32f97101d8ea5e46a9de396c535
tree1533ad50b6b33f5774a4fb21943d9c505ef549d2
parent4a94795bd29e90045053107a6cd79942d2b02ccd
gve: Fix the queue page list allocated pages count

[ Upstream commit a95069ecb7092d03b2ea1c39ee04514fe9627540 ]

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: f5cedc84a30d ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/google/gve/gve_main.c