summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/dsi/dsi_host.c
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2018-04-03 23:38:45 +0100
committerRob Clark <robdclark@gmail.com>2018-06-03 16:48:59 -0400
commit03c94d60261c28689465a16086eb290ab3012aa3 (patch)
tree06fe1c76c5ed10238e182ef873632dd06ed1a937 /drivers/gpu/drm/msm/dsi/dsi_host.c
parent4e4902324a9b46a9111d5e514301e154f938238a (diff)
drm/msm: Fix possible null dereference on failure of get_pages()
Commit 62e3a3e342af 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: 62e3a3e342af ("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>
Diffstat (limited to 'drivers/gpu/drm/msm/dsi/dsi_host.c')
0 files changed, 0 insertions, 0 deletions