diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-25 15:51:34 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-25 15:51:34 -0700 |
| commit | 23dec079ae220bc0c2e47cf9ae6e4c35b79f45bc (patch) | |
| tree | 2982f3cc0253e301ce561f1069622d4bd96e2f71 | |
| parent | 61bb06dc05e819700711099937d2688d5ea929ed (diff) | |
| parent | 0c53b526c049c1e8bc1048b5ed8f80996e4a4be6 (diff) | |
Merge "ASoC: msm-cpe: Fix range checking in function fw_name_store"
| -rw-r--r-- | sound/soc/codecs/wcd_cpe_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index 3b681f53b17a..9218786f913f 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -1731,10 +1731,10 @@ static ssize_t fw_name_store(struct wcd_cpe_core *core, if (pos) copy_count = pos - buf; - if (copy_count > WCD_CPE_IMAGE_FNAME_MAX) { + if (copy_count > (WCD_CPE_IMAGE_FNAME_MAX - 1)) { dev_err(core->dev, "%s: Invalid length %d, max allowed %d\n", - __func__, copy_count, WCD_CPE_IMAGE_FNAME_MAX); + __func__, copy_count, WCD_CPE_IMAGE_FNAME_MAX - 1); return -EINVAL; } |
