summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-04 11:41:12 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-04 11:41:12 -0700
commitc1291c57d1f131e6cdde86bd7f27052b90f39d84 (patch)
tree20d0c7db26a3d613caf764ba95a9d40d61c47cb5
parent105b2da4bc21c5de2fe1ec807aea8348705f4dba (diff)
parent5206b51937f250d704ec39d990d3b574b87826d9 (diff)
Merge "asoc : msm: Fix zero size pointer issue"
-rw-r--r--sound/soc/msm/qdsp6v2/q6asm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c
index 2f048fddcb08..3f90347d491c 100644
--- a/sound/soc/msm/qdsp6v2/q6asm.c
+++ b/sound/soc/msm/qdsp6v2/q6asm.c
@@ -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);