]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dlink: handle copy_thresh allocation failure
authorYeounsu Moon <yyyynoom@gmail.com>
Sun, 28 Sep 2025 19:01:24 +0000 (04:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:38 +0000 (11:56 +0200)
commit9d49e4b14609e1a20d931e718962c4b6b5485174
treeaa89f8a5ad8117062650d7d5b080973273d932d7
parent4d7fac287288d0c2e9acb8ba35d3531ad5a47d4e
net: dlink: handle copy_thresh allocation failure

[ Upstream commit 8169a6011c5fecc6cb1c3654c541c567d3318de8 ]

The driver did not handle failure of `netdev_alloc_skb_ip_align()`.
If the allocation failed, dereferencing `skb->protocol` could lead to
a NULL pointer dereference.

This patch tries to allocate `skb`. If the allocation fails, it falls
back to the normal path.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Tested-on: D-Link DGE-550T Rev-A3
Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250928190124.1156-1-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/dlink/dl2k.c