Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac601162 authored by Prakruthi Deepak Heragu's avatar Prakruthi Deepak Heragu
Browse files

msm: cvp: Fix NULL pointer error when DEBUG_FS is disabled



Add extra check to avoid NULL pointer derefernce when DEBUG_FS is
disabled.

Change-Id: I84f4385b91250ea6a200ff36c679f448229da6c6
Signed-off-by: default avatarPrakruthi Deepak Heragu <pheragu@codeaurora.org>
parent cba97f25
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -349,7 +349,8 @@ struct dentry *msm_cvp_debugfs_init_core(struct msm_cvp_core *core,

	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "core%d", core->id);
	dir = debugfs_create_dir(debugfs_name, parent);
	if (!dir) {
	if (IS_ERR_OR_NULL(dir)) {
		dir = NULL;
		dprintk(CVP_ERR, "Failed to create debugfs for msm_cvp\n");
		goto failed_create_dir;
	}
@@ -495,7 +496,8 @@ struct dentry *msm_cvp_debugfs_init_inst(struct msm_cvp_inst *inst,
	idata->inst = inst;

	dir = debugfs_create_dir(debugfs_name, parent);
	if (!dir) {
	if (IS_ERR_OR_NULL(dir)) {
		dir = NULL;
		dprintk(CVP_ERR, "Failed to create debugfs for msm_cvp\n");
		goto failed_create_dir;
	}