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

Commit 9cb71d37 authored by Shaoqing Liu's avatar Shaoqing Liu Committed by Srinivasarao P
Browse files

soc: qcom: dcc: Avoid huge memory allcation



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

CRs-Fixed: 2224975
Change-Id: I40f4211468c93ece42b85e1f2d326b16965bce22
Signed-off-by: default avatarShaoqing Liu <shaoqingliu@codeaurora.org>
Signed-off-by: default avatarSrinivasarao P <spathi@codeaurora.org>
parent 21d578aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -722,7 +722,8 @@ static int dcc_config_add(struct dcc_drvdata *drvdata, unsigned int addr,

	mutex_lock(&drvdata->mutex);

	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;