Skip to content

Commit 825fc49

Browse files
tumicdqHans Verkuil
authored andcommitted
media: mgb4: Fix double debugfs remove
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: 0ab1367 ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Cc: <stable@vger.kernel.org> [hverkuil: added Fixes/Cc tags]
1 parent 1613e60 commit 825fc49

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/media/pci/mgb4/mgb4_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev)
642642
struct mgb4_dev *mgbdev = pci_get_drvdata(pdev);
643643
int i;
644644

645-
#ifdef CONFIG_DEBUG_FS
646-
debugfs_remove_recursive(mgbdev->debugfs);
647-
#endif
648645
#if IS_REACHABLE(CONFIG_HWMON)
649646
hwmon_device_unregister(mgbdev->hwmon_dev);
650647
#endif
@@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev)
659656
if (mgbdev->vin[i])
660657
mgb4_vin_free(mgbdev->vin[i]);
661658

659+
#ifdef CONFIG_DEBUG_FS
660+
debugfs_remove_recursive(mgbdev->debugfs);
661+
#endif
662+
662663
device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups);
663664
free_spi(mgbdev);
664665
free_i2c(mgbdev);

0 commit comments

Comments
 (0)