From: Steve Lin Date: Mon, 14 Nov 2016 18:25:57 +0000 (-0500) Subject: mailbox: bcm-pdc: PDC driver leaves debugfs files after removal X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9310f1ded44067b2da61fa0471ca5b7768dd28ae;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mailbox: bcm-pdc: PDC driver leaves debugfs files after removal Minor fix to ensure that debugfs stats pseudo-files are removed when driver module is unloaded. Previously, the call to debugfs_remove_recursive() was never being called since the directory was not empty, and a seg fault would occur if another process tried to access these leftover files. Signed-off-by: Steve Lin Signed-off-by: Rob Rice Reviewed-by: Andy Gospodarek Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c index 3b4ebbe81964..c9434a756bf3 100644 --- a/drivers/mailbox/bcm-pdc-mailbox.c +++ b/drivers/mailbox/bcm-pdc-mailbox.c @@ -492,10 +492,8 @@ static void pdc_setup_debugfs(struct pdc_state *pdcs) static void pdc_free_debugfs(void) { - if (debugfs_dir && simple_empty(debugfs_dir)) { - debugfs_remove_recursive(debugfs_dir); - debugfs_dir = NULL; - } + debugfs_remove_recursive(debugfs_dir); + debugfs_dir = NULL; } /**