diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-07-26 23:34:31 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-07-26 23:34:31 -0700 |
| commit | 57fdba1a12fa9d850ef6546a2e22b8b409f8b85c (patch) | |
| tree | 3252f8de187ab4572b811425d4f3804198e0dd73 | |
| parent | cb50168ee3856cc18b4635e3c4d61dcc5d7486af (diff) | |
| parent | e9276dfdcd28de0b272bb9d49bea0d7f747d2746 (diff) | |
Merge "ASoC: msm: qdsp6v2: DAP: Update check to validate data length"
| -rw-r--r-- | sound/soc/msm/qdsp6v2/msm-ds2-dap-config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-ds2-dap-config.c b/sound/soc/msm/qdsp6v2/msm-ds2-dap-config.c index 48180cf5e337..ad2f2e9865c3 100644 --- a/sound/soc/msm/qdsp6v2/msm-ds2-dap-config.c +++ b/sound/soc/msm/qdsp6v2/msm-ds2-dap-config.c @@ -1523,8 +1523,9 @@ static int msm_ds2_dap_get_param(u32 cmd, void *arg) } /* Return if invalid length */ - if (dolby_data->length > - (DOLBY_MAX_LENGTH_INDIVIDUAL_PARAM - DOLBY_PARAM_PAYLOAD_SIZE)) { + if ((dolby_data->length > + (DOLBY_MAX_LENGTH_INDIVIDUAL_PARAM - DOLBY_PARAM_PAYLOAD_SIZE)) || + (dolby_data->length <= 0)) { pr_err("Invalid length %d", dolby_data->length); rc = -EINVAL; goto end; |
