]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 2 Jun 2025 10:34:29 +0000 (03:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:18 +0000 (11:07 +0100)
commit2e5ead9e4e91fbe7799bd38afd8904543be1cb51
tree777295a6ae4dba973eac4d09446f360827a16c6e
parent88302dd9bf931b98a4bdb3b98547c1cc465d1de1
gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO

[ Upstream commit 12c331b29c7397ac3b03584e12902990693bc248 ]

gve_alloc_pending_packet() can return NULL, but gve_tx_add_skb_dqo()
did not check for this case before dereferencing the returned pointer.

Add a missing NULL check to prevent a potential NULL pointer
dereference when allocation fails.

This improves robustness in low-memory scenarios.

Fixes: a57e5de476be ("gve: DQO: Add TX path")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/google/gve/gve_tx_dqo.c