Linux CAN drivers development
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Haoxiang Li <haoxiang_li2024@163.com>
Cc: mkl@pengutronix.de, linux-can@vger.kernel.org
Subject: Re: [PATCH] can: etas_es58x: fix devlink leak on probe failure
Date: Mon, 30 Nov 2026 12:23:08 +0100	[thread overview]
Message-ID: <7064c83c-c234-46ae-a09c-7ae653fb38d0@kernel.org> (raw)
In-Reply-To: <5aed7937.c5a.1a225ef2456.Coremail.haoxiang_li2024@163.com>

On 29/11/2026 at 07:12, Haoxiang Li wrote:
> At 2026-11-28 23:12:09, "Vincent Mailhol" <mailhol@kernel.org> wrote:
>>
>> The fix looks correct, but with this, the if branch looks nearly
>> identical to es58x_disconnect(). Couldn't the clean-up logic be
>> factorized in one location? For example by moving those three lines:
>>
>> 	devlink_unregister(priv_to_devlink(es58x_dev));
>> 	devlink_free(priv_to_devlink(es58x_dev));
>> 	usb_set_intfdata(intf, NULL);
>>
>>from es58x_disconnect() to es58x_free_netdevs()?
>>
> 
> Thanks for the suggestion! I agree that we can put the cleanup in
> one place.
> 
>  es58x_free_urbs() have to run before devlink_free(), and preferably
>  after devlink_unregister() to prevent new devlink operations during
>  teardown.
> 
> How about moving es58x_free_urbs()  into es58x_free_netdevs() either?

Yes, this makes sense. With that, you might also what to rename the
function from es58x_free_netdevs() to es58x_cleanup(), or similar, to
reflect the new extended scope.

Feel free to adjust the parameters accordingly.



Yours sincerely,
Vincent Mailhol


      reply	other threads:[~2026-11-30 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 13:54 [PATCH] can: etas_es58x: fix devlink leak on probe failure Haoxiang Li
2026-11-28 15:12 ` Vincent Mailhol
2026-11-29  6:12   ` Haoxiang Li
2026-11-30 11:23     ` Vincent Mailhol [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=7064c83c-c234-46ae-a09c-7ae653fb38d0@kernel.org \
    --to=mailhol@kernel.org \
    --cc=haoxiang_li2024@163.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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