]> git.baikalelectronics.ru Git - kernel.git/commit
clk: clean up everything on debugfs error
authorAlex Elder <alex.elder@linaro.org>
Wed, 27 Nov 2013 15:39:49 +0000 (09:39 -0600)
committerMike Turquette <mturquette@linaro.org>
Wed, 27 Nov 2013 20:48:21 +0000 (12:48 -0800)
commit1a415bd6103643ff93da888a16d29087c0f031e8
tree731a910ff86bc56b04f1bb4ac8197d97503d7935
parent1386d2af13b0b2ba423da1adf79ceabb7ea834e9
clk: clean up everything on debugfs error

[Maybe the third time will be the charm. -Alex]

If CONFIG_COMMON_CLK_DEBUG is defined, clk_debug_create_one() is
called to populate a debugfs directory with a few entries that are
common for all clock types.

If an error happens after creating the first one debugfs_remove() is
called on the clock's directory.  The problem with this is that no
cleanup is done on the debugfs files already created in that
directory, so the directory never actually gets removed.   This
problem is silently ignored.

Fix this by calling debugfs_remove_recursive() instead.  Reset the
clk->dentry field to null afterward, to ensure it can't be mistaken
as a valid pointer.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk.c