path: root/drivers
diff options
authorGustavo A. R. Silva <>2018-02-02 06:32:23 -0600
committerRob Clark <>2018-03-19 06:33:34 -0400
commit5abc7dd7b5a0f51a6c7d9cb3ce72b910ba3cef7b (patch)
tree82d1c7f88289c6159ce282679c37c50d4ecfcf0c /drivers
parentfb48989edb628342af0fad478174ae30b2e1e23a (diff)
drm/msm/adreno/a5xx_debugfs: fix potential NULL pointer dereference
_minor_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after _minor_ has been null checked. Fixes: 024ad8df763f ("drm/msm: add a5xx specific debugfs") Signed-off-by: Gustavo A. R. Silva <> Signed-off-by: Rob Clark <>
Diffstat (limited to 'drivers')
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index 6b279414b9c0..059ec7d394d0 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -159,13 +159,15 @@ DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n");
int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
- struct drm_device *dev = minor->dev;
+ struct drm_device *dev;
struct dentry *ent;
int ret;
if (!minor)
return 0;
+ dev = minor->dev;
ret = drm_debugfs_create_files(a5xx_debugfs_list,
minor->debugfs_root, minor);