瀏覽代碼

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

qctecmdr 4 年之前
父節點
當前提交
1961183b41
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 6 1
      msm/dsi/dsi_ctrl.c
  2. 4 1
      msm/dsi/dsi_display.c

+ 6 - 1
msm/dsi/dsi_ctrl.c

@@ -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

+ 4 - 1
msm/dsi/dsi_display.c

@@ -2097,7 +2097,10 @@ error:
 
 static int dsi_display_debugfs_deinit(struct dsi_display *display)
 {
-	debugfs_remove_recursive(display->root);
+	if (display->root) {
+		debugfs_remove_recursive(display->root);
+		display->root = NULL;
+	}
 
 	return 0;
 }