drm/msm: fix leak in failed get_pages
authorPrakash Kamliya <pkamliya@codeaurora.org>
Mon, 4 Dec 2017 13:40:15 +0000 (19:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:01:22 +0000 (11:01 +0100)
commit4df82a41e819133194e015c14424ae4e96ca061f
tree9c58baa0d75fce821cea0b0802512c486cc0d1df
parentb3cff08483d06379bc608206374fb249a2199847
drm/msm: fix leak in failed get_pages

[ Upstream commit 62e3a3e342af3c313ab38603811ecdb1fcc79edb ]

get_pages doesn't keep a reference of the pages allocated
when it fails later in the code path. This can lead to
a memory leak. Keep reference of the allocated pages so
that it can be freed when msm_gem_free_object gets called
later during cleanup.

Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/msm_gem.c