Commit 5abc7dd7 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Rob Clark

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: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent fb48989e
...@@ -159,13 +159,15 @@ DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n"); ...@@ -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) 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; struct dentry *ent;
int ret; int ret;
if (!minor) if (!minor)
return 0; return 0;
dev = minor->dev;
ret = drm_debugfs_create_files(a5xx_debugfs_list, ret = drm_debugfs_create_files(a5xx_debugfs_list,
ARRAY_SIZE(a5xx_debugfs_list), ARRAY_SIZE(a5xx_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment