msm: mdss: fix use of uninitialized local variable

This change fixes unitilized local variable being used and
checks for the valid format in concurrent writeback case before
using the format parameters.

CRs-Fixed: 1110015
Change-Id: I61a3e20af1d0a4db7a7db454ae35b810639744ae
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This commit is contained in:
Abhijit Kulkarni 2017-01-05 11:05:23 -08:00
parent 314869eb56
commit aaac291341
2 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -521,6 +521,10 @@ int mdss_mdp_writeback_prepare_cwb(struct mdss_mdp_ctl *ctl,
* updating img_width with buffer->planes[0].stride
*/
fmt = mdss_mdp_get_format_params(buffer->format);
if (!fmt) {
pr_err("invalid format for cwb\n");
return -EINVAL;
}
mdss_mdp_get_plane_sizes(fmt, ctx->img_width,
buffer->height, &ps, 0, 0);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -5279,7 +5279,7 @@ static int pp_hist_collect(struct mdp_histogram_data *hist,
u32 block)
{
int ret = 0;
u32 sum;
int sum = 0;
char __iomem *v_base = NULL;
unsigned long flag;
struct mdss_data_type *mdata = mdss_mdp_get_mdata();