diff --git a/drivers/gpu/msm/adreno.h b/drivers/gpu/msm/adreno.h index f1cda8da3c56..e34badc8d3b7 100644 --- a/drivers/gpu/msm/adreno.h +++ b/drivers/gpu/msm/adreno.h @@ -1299,7 +1299,9 @@ void adreno_context_debugfs_init(struct adreno_device *adreno_dev, static inline void adreno_debugfs_init(struct adreno_device *adreno_dev) { } static inline void adreno_context_debugfs_init(struct adreno_device *device, struct adreno_context *context) - { } +{ + context->debug_root = NULL; +} #endif /** diff --git a/drivers/gpu/msm/adreno_drawctxt.c b/drivers/gpu/msm/adreno_drawctxt.c index d42ac6d3bab5..9c83ee2ed354 100644 --- a/drivers/gpu/msm/adreno_drawctxt.c +++ b/drivers/gpu/msm/adreno_drawctxt.c @@ -464,7 +464,8 @@ void adreno_drawctxt_detach(struct kgsl_context *context) debugfs_remove_recursive(drawctxt->debug_root); /* The debugfs file has a reference, release it */ - kgsl_context_put(context); + if (drawctxt->debug_root) + kgsl_context_put(context); /* * internal_timestamp is set in adreno_ringbuffer_addcmds,