mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hangyu Hua <hbh25y@gmail.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: wg@grandegger.com, davem@davemloft.net, kuba@kernel.org,
	stefan.maetje@esd.eu, mailhol.vincent@wanadoo.fr,
	paskripkin@gmail.com, thunder.leizhen@huawei.com,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] can: usb: fix a possible memory leak in esd_usb2_start_xmit
Date: Mon, 28 Feb 2022 16:06:07 +0800	[thread overview]
Message-ID: <340590e9-2150-cd6e-5333-21c4fde59e98@gmail.com> (raw)
In-Reply-To: <20220228075146.hvui3iow7niupij4@pengutronix.de>

Yes. I will create a patch later.

Thanks.

On 2022/2/28 15:51, Marc Kleine-Budde wrote:
> On 28.02.2022 10:05:03, Hangyu Hua wrote:
>> I get it. But this means ems_usb_start_xmit have a redundant
>> dev_kfree_skb beacause can_put_echo_skb delete original skb and
>> can_free_echo_skb delete the cloned skb. While this code is harmless
>> do you think we need to delete it ?
> 
> ACK. This dev_kfree_skb() should be deleted:
> 
> | 	err = usb_submit_urb(urb, GFP_ATOMIC);
> | 	if (unlikely(err)) {
> | 		can_free_echo_skb(netdev, context->echo_index, NULL);
> |
> | 		usb_unanchor_urb(urb);
> | 		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
> | 		dev_kfree_skb(skb);
> 
> Can you create a patch?
> 
> regards,
> Marc
> 

      reply	other threads:[~2022-02-28  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25  6:00 Hangyu Hua
2022-02-25 15:56 ` Marc Kleine-Budde
2022-02-28  2:05   ` Hangyu Hua
2022-02-28  7:51     ` Marc Kleine-Budde
2022-02-28  8:06       ` Hangyu Hua [this message]

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=340590e9-2150-cd6e-5333-21c4fde59e98@gmail.com \
    --to=hbh25y@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    --cc=stefan.maetje@esd.eu \
    --cc=thunder.leizhen@huawei.com \
    --cc=wg@grandegger.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

all inboxes | Powered by JetHome®