Skip to content

Commit

Permalink
drm/exynos: Fix (more) freeing issues in exynos_drm_drv.c
Browse files Browse the repository at this point in the history
The following commit [0] fixed a use-after-free, but left the subdrv open
in the error path.

[0] commit 6ca605f
drm/exynos: Fix freeing issues in exynos_drm_drv.c

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
djkurtz authored and daeinki committed Mar 20, 2014
1 parent 27410e8 commit 85d898b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,24 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)

ret = exynos_drm_subdrv_open(dev, file);
if (ret)
goto out;
goto err_file_priv_free;

anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops,
NULL, 0);
if (IS_ERR(anon_filp)) {
ret = PTR_ERR(anon_filp);
goto out;
goto err_subdrv_close;
}

anon_filp->f_mode = FMODE_READ | FMODE_WRITE;
file_priv->anon_filp = anon_filp;

return ret;
out:

err_subdrv_close:
exynos_drm_subdrv_close(dev, file);

err_file_priv_free:
kfree(file_priv);
file->driver_priv = NULL;
return ret;
Expand Down

0 comments on commit 85d898b

Please sign in to comment.