Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
Cc: <stable@vger.kernel.org>
[hverkuil: added Fixes/Cc tags]

authored by

Martin Tůma and committed by
Hans Verkuil
825fc494 1613e604

+4 -3
+4 -3
drivers/media/pci/mgb4/mgb4_core.c
··· 642 642 struct mgb4_dev *mgbdev = pci_get_drvdata(pdev); 643 643 int i; 644 644 645 - #ifdef CONFIG_DEBUG_FS 646 - debugfs_remove_recursive(mgbdev->debugfs); 647 - #endif 648 645 #if IS_REACHABLE(CONFIG_HWMON) 649 646 hwmon_device_unregister(mgbdev->hwmon_dev); 650 647 #endif ··· 655 658 for (i = 0; i < MGB4_VIN_DEVICES; i++) 656 659 if (mgbdev->vin[i]) 657 660 mgb4_vin_free(mgbdev->vin[i]); 661 + 662 + #ifdef CONFIG_DEBUG_FS 663 + debugfs_remove_recursive(mgbdev->debugfs); 664 + #endif 658 665 659 666 device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups); 660 667 free_spi(mgbdev);