lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <785a3e80-7cc8-40e6-8e4f-f741a8f343af@xs4all.nl>
Date: Mon, 27 May 2024 09:36:57 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: tumic@...see.org, Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
 Martin Tůma <martin.tuma@...iteqautomotive.com>
Subject: Re: [PATCH] media: mgb4: Fix double debugfs remove

Hi Martin,

On 21/05/2024 18:22, tumic@...see.org wrote:
> From: Martin Tůma <martin.tuma@...iteqautomotive.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.

Regards,

	Hans

> 
> Signed-off-by: Martin Tůma <martin.tuma@...iteqautomotive.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ