disp: msm: dsi: check for null pointer during debugfs deinit

Add null pointer check for debugfs deinit during
unbind path. Additionally, fix debugfs init to
not free debugfs directory unintentionally.

Change-Id: I430fe8810608a8e56d6d02e996044e69b4116421
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
This commit is contained in:
Shashank Babu Chinta Venkata
2021-05-10 12:32:14 -07:00
parent 30ce58bf9b
commit 6c16356706
2 changed files with 10 additions and 2 deletions

View File

@@ -333,6 +333,8 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
dsi_ctrl->debugfs_root = dir;
return rc;
error_remove_dir:
debugfs_remove(dir);
error:
@@ -341,7 +343,10 @@ error:
static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
{
debugfs_remove(dsi_ctrl->debugfs_root);
if (dsi_ctrl->debugfs_root) {
debugfs_remove(dsi_ctrl->debugfs_root);
dsi_ctrl->debugfs_root = NULL;
}
return 0;
}
#else