From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Holger Brunck <holger.brunck@hitachienergy.com>, netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, andrew+netdev@lunn.ch,
qiang.zhao@nxp.com, horms@kernel.org
Subject: Re: [PATCH net] net: wan: fsl_ucc_hdlc: free tx_skbuff in uhdlc_memclean
Date: Tue, 5 May 2026 07:37:05 +0200 [thread overview]
Message-ID: <3e1a653b-81bc-4008-8f84-77c823aeef49@kernel.org> (raw)
In-Reply-To: <20260504161145.2217950-1-holger.brunck@hitachienergy.com>
Le 04/05/2026 à 18:11, Holger Brunck a écrit :
> When cleaning up the resources we need to iterate over the
> tx_skbuf array to free pending TX messages.
>
> Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC")
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index adf3863463f5..68f78aeabdc3 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -739,6 +739,8 @@ static int uhdlc_open(struct net_device *dev)
>
> static void uhdlc_memclean(struct ucc_hdlc_private *priv)
> {
> + int i;
> +
> qe_muram_free(ioread16be(&priv->ucc_pram->riptr));
> qe_muram_free(ioread16be(&priv->ucc_pram->tiptr));
>
> @@ -769,6 +771,11 @@ static void uhdlc_memclean(struct ucc_hdlc_private *priv)
> kfree(priv->rx_skbuff);
> priv->rx_skbuff = NULL;
>
> + for (i = 0; i < TX_BD_RING_LEN) {
> + kfree(priv->tx_skbuff[i]);
I don't think you can just kfree() an skb like this.
I think you have to call dev_kfree_skb_any() instead.
Christophe
> + priv->tx_skbuff[i] = NULL;
> + }
> +
> kfree(priv->tx_skbuff);
> priv->tx_skbuff = NULL;
>
next prev parent reply other threads:[~2026-05-05 5:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 16:11 [PATCH net] net: wan: fsl_ucc_hdlc: free tx_skbuff in uhdlc_memclean Holger Brunck
2026-05-05 5:37 ` Christophe Leroy (CS GROUP) [this message]
2026-05-05 8:33 ` Holger Brunck
2026-05-05 23:47 ` Jakub Kicinski
2026-05-06 8:27 ` Holger Brunck
2026-05-15 3:05 ` kernel test robot
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=3e1a653b-81bc-4008-8f84-77c823aeef49@kernel.org \
--to=chleroy@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=holger.brunck@hitachienergy.com \
--cc=horms@kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=qiang.zhao@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.