diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2019-01-14 11:44:10 +0300 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2019-02-13 20:39:47 +0300 |
commit | 4acc5be3cd89cc4132d8456144ee066905a58e41 (patch) | |
tree | 07942c3cc8e550b77567c70a86f98e465efbc903 /drivers/gpu/drm/drm_file.c | |
parent | e21710a893c8705360b764fa44061d72d65fb2ae (diff) | |
download | linux-4acc5be3cd89cc4132d8456144ee066905a58e41.tar.xz |
drm: plug memory leak on drm_setup() failure
Currently we fail to free and detach the drm_file when drm_setup() fails.
Use the drm_close_helper to do address that.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190114084410.15266-2-emil.l.velikov@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_file.c')
-rw-r--r-- | drivers/gpu/drm/drm_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index e9607acfb629..21fa65b68a47 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -330,8 +330,10 @@ int drm_open(struct inode *inode, struct file *filp) goto err_undo; if (need_setup) { retcode = drm_setup(dev); - if (retcode) + if (retcode) { + drm_close_helper(filp); goto err_undo; + } } return 0; |