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

Commit c7ff6529 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight-etm4x: Add size check before using Array 'addr_type'"

parents 98f00ec1 ceb2271a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ static int etm4_set_mode_exclude(struct etmv4_drvdata *drvdata, bool exclude)

	idx = config->addr_idx;

	if (idx >= ETM_MAX_SINGLE_ADDR_CMP)
		return -EINVAL;

	/*
	 * TRCACATRn.TYPE bit[1:0]: type of comparison
	 * the trace unit performs
@@ -955,6 +958,9 @@ static ssize_t addr_range_show(struct device *dev,

	spin_lock(&drvdata->spinlock);
	idx = config->addr_idx;

	if (idx >= ETM_MAX_SINGLE_ADDR_CMP)
		return -EINVAL;
	if (idx % 2 != 0) {
		spin_unlock(&drvdata->spinlock);
		return -EPERM;
@@ -990,6 +996,9 @@ static ssize_t addr_range_store(struct device *dev,

	spin_lock(&drvdata->spinlock);
	idx = config->addr_idx;

	if (idx >= ETM_MAX_SINGLE_ADDR_CMP)
		return -EINVAL;
	if (idx % 2 != 0) {
		spin_unlock(&drvdata->spinlock);
		return -EPERM;