msm: mdss: reset the skip buffer flag to avoid memory leak

Pan display path can call buffer alloc and use one of the
buffer. It will enable the skip detach enabled for that
buffer. This buffer moves to free queue when atomic api
stage next set of layers. It can lead to memory leak when
atomic API path reuse the same buffer without resetting
the detach flag. Ideally, it should be reset for each
attach call.

Change-Id: I96e2c030669539d8e5dc7205abc233ecc7118bdb
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
Dhaval Patel 2015-07-01 12:10:45 -07:00 committed by David Keitel
parent 8b9bb877e8
commit c6e6724120

View file

@ -1035,6 +1035,7 @@ static int mdss_mdp_get_img(struct msmfb_data *img,
data->addr = 0;
data->len = 0;
data->mapped = false;
data->skip_detach = false;
/* return early, mapping will be done later */
return 0;
@ -1151,7 +1152,7 @@ int mdss_mdp_data_map(struct mdss_mdp_data *data, bool rotator, int dir)
{
int i, rc = 0;
if (!data || !data->num_planes)
if (!data || !data->num_planes || data->num_planes > MAX_PLANES)
return -EINVAL;
for (i = 0; i < data->num_planes; i++) {