Commit 825fc494 authored by Martin Tůma's avatar Martin Tůma Committed by Hans Verkuil

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: default avatarMartin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 0ab13674 ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
Cc: <stable@vger.kernel.org>
[hverkuil: added Fixes/Cc tags]
parent 1613e604
...@@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev) ...@@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev)
struct mgb4_dev *mgbdev = pci_get_drvdata(pdev); struct mgb4_dev *mgbdev = pci_get_drvdata(pdev);
int i; int i;
#ifdef CONFIG_DEBUG_FS
debugfs_remove_recursive(mgbdev->debugfs);
#endif
#if IS_REACHABLE(CONFIG_HWMON) #if IS_REACHABLE(CONFIG_HWMON)
hwmon_device_unregister(mgbdev->hwmon_dev); hwmon_device_unregister(mgbdev->hwmon_dev);
#endif #endif
...@@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev) ...@@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev)
if (mgbdev->vin[i]) if (mgbdev->vin[i])
mgb4_vin_free(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); device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups);
free_spi(mgbdev); free_spi(mgbdev);
free_i2c(mgbdev); free_i2c(mgbdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment