]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
octeon_ep_vf: add NULL check for napi_build_skb()
authorDavid Carlier <devnexen@gmail.com>
Thu, 9 Apr 2026 18:40:09 +0000 (19:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 Apr 2026 22:40:49 +0000 (15:40 -0700)
commitdd66b42854705e4e4ee7f14d260f86c578bed3e3
tree0fe934139222859f16380d90ea93c77e23bdedab
parent4e5bc3ff060e6a495117a164a1ce6df5cdf1454f
octeon_ep_vf: add NULL check for napi_build_skb()

napi_build_skb() can return NULL on allocation failure. In
__octep_vf_oq_process_rx(), the result is used directly without a NULL
check in both the single-buffer and multi-fragment paths, leading to a
NULL pointer dereference.

Add NULL checks after both napi_build_skb() calls, properly advancing
descriptors and consuming remaining fragments on failure.

Fixes: 1cd3b407977c ("octeon_ep_vf: add Tx/Rx processing and interrupt support")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
Link: https://patch.msgid.link/20260409184009.930359-3-devnexen@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c