Merge "asoc : msm: Fix zero size pointer issue"

This commit is contained in:
Linux Build Service Account 2018-09-04 11:41:12 -07:00 committed by Gerrit - the friendly Code Review server
commit c1291c57d1

View file

@ -1567,6 +1567,12 @@ int q6asm_audio_client_buf_alloc_contiguous(unsigned int dir,
pr_err("%s: buffer already allocated\n", __func__);
return 0;
}
if (bufcnt == 0) {
pr_err("%s: invalid buffer count\n", __func__);
return -EINVAL;
}
mutex_lock(&ac->cmd_lock);
buf = kzalloc(((sizeof(struct audio_buffer))*bufcnt),
GFP_KERNEL);