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

Commit cd44aba1 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"

parents d30f9469 ef3868b6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}