diff options
author | Mathias Krause <minipli@googlemail.com> | 2016-06-19 08:31:30 -0400 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-06-20 12:56:36 -0400 |
commit | b7479990435713b00870df3c1d98ff66f6ef1ba2 (patch) | |
tree | 5f7a44613d502864ae257903f793ea4d377e20b8 | |
parent | eb0b947e3bf59d263f5bc7c080ce40333b515004 (diff) |
dma-buf: remove dma_buf directory on bufinfo file creation errors
Change the error handling in dma_buf_init_debugfs() to remove the
"dma_buf" directory if creating the "bufinfo" file fails. No need to
have an empty debugfs directory around.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
-rw-r--r-- | drivers/dma-buf/dma-buf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 7094b19bb495..f03e51561199 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c | |||
@@ -907,8 +907,11 @@ static int dma_buf_init_debugfs(void) | |||
907 | 907 | ||
908 | err = dma_buf_debugfs_create_file("bufinfo", NULL); | 908 | err = dma_buf_debugfs_create_file("bufinfo", NULL); |
909 | 909 | ||
910 | if (err) | 910 | if (err) { |
911 | pr_debug("dma_buf: debugfs: failed to create node bufinfo\n"); | 911 | pr_debug("dma_buf: debugfs: failed to create node bufinfo\n"); |
912 | debugfs_remove_recursive(dma_buf_debugfs_dir); | ||
913 | dma_buf_debugfs_dir = NULL; | ||
914 | } | ||
912 | 915 | ||
913 | return err; | 916 | return err; |
914 | } | 917 | } |