gve: Add NULL pointer checks when freeing irqs.
authorDavid Awogbemila <awogbemila@google.com>
Mon, 17 May 2021 21:08:13 +0000 (14:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:48 +0000 (09:00 +0200)
commitda21a35c00ff1a1794d4f166d3b3fa8db4d0f6fb
tree4221cf7b2d51d58c2fd2baebd44f942c87943cf5
parent7114438671d6ad4be746ad13d74f278db273db0c
gve: Add NULL pointer checks when freeing irqs.

[ Upstream commit 5218e919c8d06279884aa0baf76778a6817d5b93 ]

When freeing notification blocks, we index priv->msix_vectors.
If we failed to allocate priv->msix_vectors (see abort_with_msix_vectors)
this could lead to a NULL pointer dereference if the driver is unloaded.

Fixes: 893ce44df565 ("gve: Add basic driver framework for Compute Engine Virtual NIC")
Signed-off-by: David Awogbemila <awogbemila@google.com>
Acked-by: Willem de Brujin <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/google/gve/gve_main.c