net: xilinx: axienet: Add error handling for RX metadata pointer retrieval
authorAbin Joseph <abin.joseph@amd.com>
Wed, 3 Sep 2025 02:52:13 +0000 (08:22 +0530)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Sep 2025 14:13:08 +0000 (07:13 -0700)
commit8bbceba7dc5090c00105e006ce28d1292cfda8dd
treeb487e73efcef3ac5ac90bda5687788fc6939ee46
parentd93b10e89471002d16556f14b804b5a7d9924142
net: xilinx: axienet: Add error handling for RX metadata pointer retrieval

Add proper error checking for dmaengine_desc_get_metadata_ptr() which
can return an error pointer and lead to potential crashes or undefined
behaviour if the pointer retrieval fails.

Properly handle the error by unmapping DMA buffer, freeing the skb and
returning early to prevent further processing with invalid data.

Fixes: 6a91b846af85 ("net: axienet: Introduce dmaengine support")
Signed-off-by: Abin Joseph <abin.joseph@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/20250903025213.3120181-1-abin.joseph@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c