From: Toke Høiland-Jørgensen Date: Mon, 24 Jan 2022 14:35:29 +0000 (+0100) Subject: net: cpsw: Properly initialise struct page_pool_params X-Git-Tag: Ubuntu-5.15.0-20.20~29 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=83fd7e6e648b25a9260cdd556e8419eaa38ce8f2;p=mirror_ubuntu-jammy-kernel.git net: cpsw: Properly initialise struct page_pool_params BugLink: https://bugs.launchpad.net/bugs/1959879 [ Upstream commit c63003e3d99761afb280add3b30de1cf30fa522b ] The cpsw driver didn't properly initialise the struct page_pool_params before calling page_pool_create(), which leads to crashes after the struct has been expanded with new parameters. The second Fixes tag below is where the buggy code was introduced, but because the code was moved around this patch will only apply on top of the commit in the first Fixes tag. Fixes: c5013ac1dd0e ("net: ethernet: ti: cpsw: move set of common functions in cpsw_priv") Fixes: 9ed4050c0d75 ("net: ethernet: ti: cpsw: add XDP support") Reported-by: Colin Foster Signed-off-by: Toke Høiland-Jørgensen Tested-by: Colin Foster Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Paolo Pisati --- diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c index 6bb5ac51d23c..f8e591d69d2c 100644 --- a/drivers/net/ethernet/ti/cpsw_priv.c +++ b/drivers/net/ethernet/ti/cpsw_priv.c @@ -1144,7 +1144,7 @@ int cpsw_fill_rx_channels(struct cpsw_priv *priv) static struct page_pool *cpsw_create_page_pool(struct cpsw_common *cpsw, int size) { - struct page_pool_params pp_params; + struct page_pool_params pp_params = {}; struct page_pool *pool; pp_params.order = 0;