summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMartin Tůma <martin.tuma@digiteqautomotive.com>2024-05-21 19:22:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-16 14:50:58 +0300
commit252204b634efffd8b167d77413c93d0192aaf5f6 (patch)
tree08d67dea5767bfd6b7adb6cd0b65843d177f3f55 /drivers/media
parent3dc2b2b749bed3c22833bbd7160e8cf4c9497bd8 (diff)
downloadlinux-252204b634efffd8b167d77413c93d0192aaf5f6.tar.xz
media: mgb4: Fix double debugfs remove
commit 825fc49497957310e421454fe3fb8b8d8d8e2dd2 upstream. 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 <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Cc: <stable@vger.kernel.org> [hverkuil: added Fixes/Cc tags] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/mgb4/mgb4_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c
index 9bcf10a77fd3..97c833a8deb3 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);