]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Sep 2025 01:47:49 +0000 (18:47 -0700)
commit8169a6011c5fecc6cb1c3654c541c567d3318de8
treec48d2fe6e774fece36f10d71901f5f4b404ce4fe
parentf017156aea60db8720e47591ed1e041993381ad2
net: dlink: handle copy_thresh allocation failure

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>
drivers/net/ethernet/dlink/dl2k.c