From: Colin Foster <colin.foster@in-advantage.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Murali Karicheri <m-karicheri2@ti.com>,
"David S. Miller" <davem@davemloft.net>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-omap@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: cpsw: Properly initialise struct page_pool_params
Date: Mon, 24 Jan 2022 21:15:22 -0800 [thread overview]
Message-ID: <20220125051522.GA1171881@euler> (raw)
In-Reply-To: <20220124143531.361005-1-toke@redhat.com>
On Mon, Jan 24, 2022 at 03:35:29PM +0100, Toke Høiland-Jørgensen wrote:
> 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 <colin.foster@in-advantage.com>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---
> drivers/net/ethernet/ti/cpsw_priv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c
> index ba220593e6db..8f6817f346ba 100644
> --- a/drivers/net/ethernet/ti/cpsw_priv.c
> +++ b/drivers/net/ethernet/ti/cpsw_priv.c
> @@ -1146,7 +1146,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;
> --
> 2.34.1
>
Works for me. Thanks Toke! Hopefully my tested by tag addition is done
correctly:
Tested-by: Colin Foster <colin.foster@in-advantage.com>
next prev parent reply other threads:[~2022-01-25 5:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 14:35 [PATCH net] net: cpsw: Properly initialise struct page_pool_params Toke Høiland-Jørgensen
2022-01-24 18:51 ` Colin Foster
2022-01-25 5:15 ` Colin Foster [this message]
2022-01-25 10:22 ` Toke Høiland-Jørgensen
2022-01-25 8:48 ` Jesper Dangaard Brouer
2022-01-25 16:46 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220125051522.GA1171881@euler \
--to=colin.foster@in-advantage.com \
--cc=alexei.starovoitov@gmail.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=ilias.apalodimas@linaro.org \
--cc=ivan.khoronzhuk@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).