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

Commit 2ec386cf authored by Zhang Yuanfang's avatar Zhang Yuanfang Committed by ZhangYuanfang
Browse files

soc: qcom: Add check of len and base before dcc_config_add



Add check of len and base before dcc_config_add for invalid value.

Change-Id: Ia10ea54a24b076184a99096bb7dfc7c2790773c2
Signed-off-by: default avatarZhangYuanfang <zhangyuanfang@codeaurora.org>
parent 6beeaa5c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -990,6 +990,14 @@ static ssize_t dcc_store_config(struct device *dev,
		apb_bus = 1;
	}

	if (len == 0)
		len = 1;

	if (base == 0) {
		dev_err(drvdata->dev, "DCC: Invalid  Address\n");
		return -EINVAL;
	}

	ret = dcc_config_add(drvdata, base, len, apb_bus);
	if (ret)
		return ret;