linux_dsm_epyc7002/drivers/gpu/drm/msm
Ben Hutchings 03c94d6026 drm/msm: Fix possible null dereference on failure of get_pages()
Commit 62e3a3e342 changed get_pages() to initialise
msm_gem_object::pages before trying to initialise msm_gem_object::sgt,
so that put_pages() would properly clean up pages in the failure
case.

However, this means that put_pages() now needs to check that
msm_gem_object::sgt is not null before trying to clean it up, and
this check was only applied to part of the cleanup code.  Move
it all into the conditional block.  (Strictly speaking we don't
need to make the kfree() conditional, but since we can't avoid
checking for null ourselves we may as well do so.)

Fixes: 62e3a3e342 ("drm/msm: fix leak in failed get_pages")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-06-03 16:48:59 -04:00
..
adreno remoteproc updates for v4.17 2018-04-10 12:09:27 -07:00
disp drm/msm: Add modifier to mdp_get_format arguments 2018-06-03 16:48:59 -04:00
dsi drm/msm/dsi: implement auto PHY timing calculator for 10nm PHY 2018-06-03 16:48:59 -04:00
edp
hdmi drm/msm/hdmi: fix semicolon.cocci warnings 2018-02-20 10:41:21 -05:00
Kconfig
Makefile drm/msm: rename mdp->disp 2018-03-19 06:33:35 -04:00
msm_atomic.c
msm_debugfs.c
msm_debugfs.h
msm_drv.c drm/msm: Replace gem_object deprecated functions 2018-02-20 10:41:21 -05:00
msm_drv.h drm/msm: strip out msm_fence_cb 2018-03-19 06:33:35 -04:00
msm_fb.c drm/msm: Add modifier to mdp_get_format arguments 2018-06-03 16:48:59 -04:00
msm_fbdev.c
msm_fence.c
msm_fence.h drm/msm: strip out msm_fence_cb 2018-03-19 06:33:35 -04:00
msm_gem_prime.c
msm_gem_shrinker.c
msm_gem_submit.c
msm_gem_vma.c drm/msm: Pass the correct aperture end to drm_mm_init 2018-02-20 10:41:22 -05:00
msm_gem.c drm/msm: Fix possible null dereference on failure of get_pages() 2018-06-03 16:48:59 -04:00
msm_gem.h
msm_gpu.c drm/msm/gpu: Set number of clocks to 0 if the list allocation fails 2018-02-20 10:41:22 -05:00
msm_gpu.h
msm_iommu.c
msm_kms.h drm/msm: Add modifier to mdp_get_format arguments 2018-06-03 16:48:59 -04:00
msm_mmu.h
msm_perf.c
msm_rd.c
msm_ringbuffer.c drm/msm: Replace gem_object deprecated functions 2018-02-20 10:41:21 -05:00
msm_ringbuffer.h
msm_submitqueue.c
NOTES