linux/drivers/gpu/drm/msm
Ben Hutchings 3976626ea3 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-04-19 10:08:34 -04:00
..
adreno drm/msm: fix building without debugfs 2018-03-19 06:33:39 -04:00
disp drm/msm: Add modifier to mdp_get_format arguments 2018-04-19 10:08:31 -04:00
dsi drm/msm/dsi: implement auto PHY timing calculator for 10nm PHY 2018-04-19 10:08:16 -04:00
edp drm/msm/edp: convert to msm_clk_get() 2017-10-28 11:01:33 -04:00
hdmi drm/msm/hdmi: fix semicolon.cocci warnings 2018-02-20 10:41:21 -05:00
Kconfig drm/msm/dsi: Add skeleton 10nm PHY/PLL code 2018-02-20 10:41:20 -05:00
Makefile drm/msm: rename mdp->disp 2018-03-19 06:33:35 -04:00
msm_atomic.c drm/msm: update cursors asynchronously through atomic 2017-10-28 14:02:56 -04:00
msm_debugfs.c drm/msm: add a5xx specific debugfs 2018-02-20 10:41:20 -05:00
msm_debugfs.h drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
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-04-19 10:08:31 -04:00
msm_fbdev.c Merge tag 'drm-msm-next-2017-08-22' of git://people.freedesktop.org/~robclark/linux into drm-next 2017-08-25 09:29:45 +10:00
msm_fence.c drm/msm: Support multiple ringbuffers 2017-10-28 11:01:36 -04:00
msm_fence.h drm/msm: strip out msm_fence_cb 2018-03-19 06:33:35 -04:00
msm_gem_prime.c drm/msm: Expose our reservation object when exporting a dmabuf. 2017-05-27 13:48:26 -04:00
msm_gem_shrinker.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_gem_submit.c drm/msm: add sudo flag to submit ioctl 2018-02-20 10:41:20 -05:00
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-04-19 10:08:34 -04:00
msm_gem.h drm/msm: add sudo flag to submit ioctl 2018-02-20 10:41:20 -05:00
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 drm/msm: add a5xx specific debugfs 2018-02-20 10:41:20 -05:00
msm_iommu.c drm/msm: pm runtime support for iommu 2017-04-08 06:59:31 -04:00
msm_kms.h drm/msm: Add modifier to mdp_get_format arguments 2018-04-19 10:08:31 -04:00
msm_mmu.h drm/msm: let gpu wire up it's own fault handler 2017-02-06 11:28:42 -05:00
msm_perf.c drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_rd.c Linux 4.14-rc7 2017-11-02 12:40:41 +10:00
msm_ringbuffer.c drm/msm: Replace gem_object deprecated functions 2018-02-20 10:41:21 -05:00
msm_ringbuffer.h drm/msm: Implement preemption for A5XX targets 2017-10-28 11:01:38 -04:00
msm_submitqueue.c drm/msm: Support multiple ringbuffers 2017-10-28 11:01:36 -04:00
NOTES