Commit 85d898bf8f638b7a23af95dc7d32b4a72c178637
Committed by
Inki Dae
1 parent
27410e8248
Exists in
master
and in
16 other branches
drm/exynos: Fix (more) freeing issues in exynos_drm_drv.c
The following commit [0] fixed a use-after-free, but left the subdrv open in the error path. [0] commit 6ca605f7c70895a35737435f17ae9cc5e36f1466 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>
Showing 1 changed file with 7 additions and 3 deletions Side-by-side Diff
drivers/gpu/drm/exynos/exynos_drm_drv.c
... | ... | @@ -172,20 +172,24 @@ |
172 | 172 | |
173 | 173 | ret = exynos_drm_subdrv_open(dev, file); |
174 | 174 | if (ret) |
175 | - goto out; | |
175 | + goto err_file_priv_free; | |
176 | 176 | |
177 | 177 | anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, |
178 | 178 | NULL, 0); |
179 | 179 | if (IS_ERR(anon_filp)) { |
180 | 180 | ret = PTR_ERR(anon_filp); |
181 | - goto out; | |
181 | + goto err_subdrv_close; | |
182 | 182 | } |
183 | 183 | |
184 | 184 | anon_filp->f_mode = FMODE_READ | FMODE_WRITE; |
185 | 185 | file_priv->anon_filp = anon_filp; |
186 | 186 | |
187 | 187 | return ret; |
188 | -out: | |
188 | + | |
189 | +err_subdrv_close: | |
190 | + exynos_drm_subdrv_close(dev, file); | |
191 | + | |
192 | +err_file_priv_free: | |
189 | 193 | kfree(file_priv); |
190 | 194 | file->driver_priv = NULL; |
191 | 195 | return ret; |