]> Git Repo - linux.git/commitdiff
drm: plug memory leak on drm_setup() failure
authorEmil Velikov <[email protected]>
Mon, 14 Jan 2019 08:44:10 +0000 (08:44 +0000)
committerEmil Velikov <[email protected]>
Wed, 13 Feb 2019 17:39:47 +0000 (17:39 +0000)
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 <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_file.c

index e9607acfb62925da38b000739dee946d73740c2d..21fa65b68a47f0d28664eeb9cd4d4a1707f22d65 100644 (file)
@@ -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;
 
This page took 0.057786 seconds and 4 git commands to generate.