Skip to content

Commit

Permalink
mailbox: bcm-pdc: PDC driver leaves debugfs files after removal
Browse files Browse the repository at this point in the history
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 <steven.lin1@broadcom.com>
Signed-off-by: Rob Rice <rob.rice@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
Steve Lin authored and JassiBrar committed Dec 19, 2016
1 parent 9fb0f9a commit 9310f1d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mailbox/bcm-pdc-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 9310f1d

Please sign in to comment.