]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dlink: handle dma_map_single() failure properly
authorYeounsu Moon <yyyynoom@gmail.com>
Thu, 9 Oct 2025 15:57:16 +0000 (00:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:33 +0000 (14:04 +0100)
commitc1cbcb77f0c1791807f6473662d8ab059027445c
tree5897fe772ffa410e0878ee0a8de75fd1f2cad205
parentccc9e794e8cfc9fea271b61c810c6236a8916d61
net: dlink: handle dma_map_single() failure properly

[ Upstream commit 65946eac6d888d50ae527c4e5c237dbe5cc3a2f2 ]

There is no error handling for `dma_map_single()` failures.

Add error handling by checking `dma_mapping_error()` and freeing
the `skb` using `dev_kfree_skb()` (process context) when it fails.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
Tested-on: D-Link DGE-550T Rev-A3
Suggested-by: Simon Horman <horms@kernel.org>
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/dlink/dl2k.c