]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: libwx: handle page_pool_dev_alloc_pages error
authorChenyuan Yang <chenyuan0y@gmail.com>
Mon, 7 Apr 2025 18:49:52 +0000 (13:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:08 +0000 (10:15 +0200)
commitad81d666e114ebf989fc9994d4c93d451dc60056
tree31a5f233dd8a651fab3b2296e7c5e3dfecb7124c
parentc81306c9d6d98cc8f5595abea09b55f577595c5f
net: libwx: handle page_pool_dev_alloc_pages error

[ Upstream commit 7f1ff1b38a7c8b872382b796023419d87d78c47e ]

page_pool_dev_alloc_pages could return NULL. There was a WARN_ON(!page)
but it would still proceed to use the NULL pointer and then crash.

This is similar to commit 001ba0902046
("net: fec: handle page_pool_dev_alloc_pages error").

This is found by our static analysis tool KNighter.

Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
Reviewed-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250407184952.2111299-1-chenyuan0y@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/wangxun/libwx/wx_lib.c