mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin Tůma" <tumic@gpxsee.org>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Martin Tůma" <martin.tuma@digiteqautomotive.com>
Subject: Re: [PATCH] media: mgb4: Fix double debugfs remove
Date: Mon, 27 May 2024 15:33:05 +0200	[thread overview]
Message-ID: <2366ed1f-c6e0-40ce-90f3-e1a4b2d264bb@gpxsee.org> (raw)
In-Reply-To: <785a3e80-7cc8-40e6-8e4f-f741a8f343af@xs4all.nl>

On 27. 05. 24 9:36 dop., Hans Verkuil wrote:
> Hi Martin,
> 
> On 21/05/2024 18:22, tumic@gpxsee.org wrote:
>> From: Martin Tůma <martin.tuma@digiteqautomotive.com>
>>
>> Fixes an error where debugfs_remove_recursive() is called first on a parent
>> directory and then again on a child which causes a kernel panic.
> 
> I accepted this patch for v6.10, but I would appreciate it if you can
> make an additional patch for v6.11 that removes the #ifdef CONFIG_DEBUG_FS
> lines where possible.
> 
> Most debugfs functions have a dummy implementation when that define is not
> set, so it would clean up the driver if these unnecessary #ifdefs are removed.
> 

Ok, I will do it and send the patch in the next days.

M.

> Regards,
> 
> 	Hans
> 
>>
>> Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
>> ---
>>   drivers/media/pci/mgb4/mgb4_core.c | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c
>> index 60498a5abebf..ab4f07e2e560 100644
>> --- a/drivers/media/pci/mgb4/mgb4_core.c
>> +++ b/drivers/media/pci/mgb4/mgb4_core.c
>> @@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev)
>>   	struct mgb4_dev *mgbdev = pci_get_drvdata(pdev);
>>   	int i;
>>   
>> -#ifdef CONFIG_DEBUG_FS
>> -	debugfs_remove_recursive(mgbdev->debugfs);
>> -#endif
>>   #if IS_REACHABLE(CONFIG_HWMON)
>>   	hwmon_device_unregister(mgbdev->hwmon_dev);
>>   #endif
>> @@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev)
>>   		if (mgbdev->vin[i])
>>   			mgb4_vin_free(mgbdev->vin[i]);
>>   
>> +#ifdef CONFIG_DEBUG_FS
>> +	debugfs_remove_recursive(mgbdev->debugfs);
>> +#endif
>> +
>>   	device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups);
>>   	free_spi(mgbdev);
>>   	free_i2c(mgbdev);
>>
>> base-commit: 8771b7f31b7fff91a998e6afdb60650d4bac59a5
> 
> 

      reply	other threads:[~2024-05-27 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 16:22 tumic
2024-05-27  7:36 ` Hans Verkuil
2024-05-27 13:33   ` Martin Tůma [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=2366ed1f-c6e0-40ce-90f3-e1a4b2d264bb@gpxsee.org \
    --to=tumic@gpxsee.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.tuma@digiteqautomotive.com \
    --cc=mchehab@kernel.org \
    /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®