media: mgb4: Fix double debugfs remove
Subsystems (3)
This is an automatic generated email to let you know that the following patch were queued:
Subject: media: mgb4: Fix double debugfs remove Author: Martin Tůma <[email protected]> Date: Tue May 21 18:22:54 2024 +0200
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.
Signed-off-by Martin Tůma <[email protected]>
Signed-off-by Hans Verkuil <[email protected]>
Fixes 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
Cc <[email protected]>
[hverkuil: added Fixes/Cc tags]
drivers/media/pci/mgb4/mgb4_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
---
drivers/media/pci/mgb4/mgb4_core.c +4 -3
@@ -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);