mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brandon Brnich <b-brnich@ti.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	jackson.lee <jackson.lee@chipsnmedia.com>,
	Nas Chung <nas.chung@chipsnmedia.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Darren Etheridge <detheridge@ti.com>
Subject: Re: [PATCH] media: chips-media: wave5: Fix Potential Probe Resource Leak
Date: Thu, 11 Dec 2025 16:55:50 -0600	[thread overview]
Message-ID: <a31b4b65-66ae-416a-ae93-33ade8e9ef39@ti.com> (raw)
In-Reply-To: <b17ccc682c636df47055678dacef1c435155f190.camel@collabora.com>

Hi,

On 12/11/2025 3:51 PM, Nicolas Dufresne wrote:
> Le jeudi 11 décembre 2025 à 15:36 -0600, Brandon Brnich a écrit :
>>>>
>>>> err_irq_release:
>>>> 	if (dev->irq < 0) {
>>>> 		kthread_destroy_worker(dev->worker);
>>>> 		hrtimer_cancel(&dev->hrtimer);
>>>> 	}
>>>> err_vdi_release:
>>>
>>> That's seems more then just a suggestion, I see that err_vdi_release: is reached
>>> on worker creation failure. Checking the kthread code, this will cause a use
>>> after free instead of a leak.
>>
>> Agreed with all above statements. I will update to fix use after free
>> that I introduced in v1.
>>
>>>
>>> An additional question, aren't we are supposed to also cleanup irq_thread ? We
>>> have this code being introduced in the remove function now:
>>>
>>>
>>> 		if (dev->irq_thread) {
>>> 			kthread_stop(dev->irq_thread);
>>> 			up(&dev->irq_sem);
>>> 			dev->irq_thread = NULL;
>>> 		}
>>
>> This portion of code is being introduced in Jackson's performance
>> series. I did not base my patch on this series since it hasn't been
>> accepted yet. I assumed my patch would make it in before since this is
>> easier to review than that series. Apologies if I need to base on that
>> series. Can rebase this in v2 if requested.
>>
>> Otherwise, I suggest Jackson to add irq_thread cleanup in next iteration
>> of performance series.
> 
> I see, this is good point. I discourage writing code against my upcoming PR
> branch, its not a proper tree, but for this one you may just base you patch
> against it, since it will all be sent together ideally.
> 
> https://gitlab.freedesktop.org/linux-media/users/ndufresne/-/tree/for-6.20

Will do. Since I am rebasing on this tree I will also just handle the 
irq thread cleanup in my v2.

Best,
Brandon

> 
> regards,
> Nicolas
> 

      reply	other threads:[~2025-12-11 22:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 21:31 Brandon Brnich
2025-12-02  2:06 ` jackson.lee
2025-12-11 15:04   ` Nicolas Dufresne
2025-12-11 21:36     ` Brandon Brnich
2025-12-11 21:51       ` Nicolas Dufresne
2025-12-11 22:55         ` Brandon Brnich [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=a31b4b65-66ae-416a-ae93-33ade8e9ef39@ti.com \
    --to=b-brnich@ti.com \
    --cc=detheridge@ti.com \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nas.chung@chipsnmedia.com \
    --cc=nicolas.dufresne@collabora.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®