Skip to content

Commit

Permalink
Merge "msm: mdss: Validate input argument"
Browse files Browse the repository at this point in the history
  • Loading branch information
Linux Build Service Account authored and Gerrit - the friendly Code Review server committed Oct 15, 2013
2 parents 8512360 + 30cf662 commit 7bf2b14
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/video/msm/mdss/mdss_mdp_pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3486,12 +3486,22 @@ int mdss_mdp_calib_mode(struct msm_fb_data_type *mfd,
int mdss_mdp_calib_config_buffer(struct mdp_calib_config_buffer *cfg,
u32 *copyback)
{
int ret = -1;
int counter = cfg->size / (sizeof(uint32_t) * 2);
int ret = -1, counter;
uint32_t *buff = NULL, *buff_org = NULL;
void *ptr;
int i = 0;

if (!cfg) {
pr_err("Invalid buffer pointer");
return ret;
}

if (cfg->size == 0) {
pr_err("Invalid buffer size");
return ret;
}

counter = cfg->size / (sizeof(uint32_t) * 2);
buff_org = buff = kzalloc(cfg->size, GFP_KERNEL);
if (buff == NULL) {
pr_err("Allocation failed");
Expand Down

0 comments on commit 7bf2b14

Please sign in to comment.