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

Commit a8691214 authored by Rahul Shahare's avatar Rahul Shahare Committed by Gerrit - the friendly Code Review server
Browse files

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



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

Change-Id: Id89e5422c5afce0428dd77280788d50af0a22fec
Signed-off-by: default avatarPrateek Sood <prsood@codeaurora.org>
Signed-off-by: default avatarRahul Shahare <rshaha@codeaurora.org>
parent a9e3b4c7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -285,7 +285,8 @@ struct dentry *msm_vidc_debugfs_init_core(struct msm_vidc_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(VIDC_ERR, "Failed to create debugfs for msm_vidc\n");
		goto failed_create_dir;
	}
@@ -503,7 +504,8 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst,
	idata->inst = inst;

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