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

Commit be33f0a3 authored by Tingwei Zhang's avatar Tingwei Zhang Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: dcc_v2: Avoid huge memory allcation



Check size of DCC configuration. Limit the size according
to SRAM size.

Change-Id: Ib846c92458e2fef8c45128b9b83d1c549b293370
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent b8f54403
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -889,7 +889,8 @@ static int dcc_config_add(struct dcc_drvdata *drvdata, unsigned int addr,
		goto err;
	}

	if (!len) {
	/* Check the len to avoid allocate huge memory */
	if (!len || len > (drvdata->ram_size / 8)) {
		dev_err(drvdata->dev, "DCC: Invalid length\n");
		ret = -EINVAL;
		goto err;