Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd84f1d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm-cpe: Fix range checking in function fw_name_store" into msm-4.9

parents e7b1a5ee fff10631
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1725,10 +1725,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;
	}